Okay, here's a zsh script to create that project structure.
Save the following code into a file, for example, create_project.sh:
#!/bin/zsh
# Project root directory name
PROJECT_NAME="academic-ai-advisor"
# --- Main Script ---
echo "🚀 Creating project structure for '$PROJECT_NAME'..."
# 1. Create the root project directory
if [ -d "$PROJECT_NAME" ]; then
echo "⚠️ Directory '$PROJECT_NAME' already exists. Skipping root directory creation."
else
mkdir "$PROJECT_NAME"
echo "✅ Created root directory: $PROJECT_NAME/"
fi
# Change into the project directory to make subsequent commands simpler
cd "$PROJECT_NAME" || { echo "❌ Error: Could not change into $PROJECT_NAME. Aborting."; exit 1; }
# 2. Create subdirectories
echo "📁 Creating subdirectories..."
mkdir -p \
config \
services \
schemas \
utils \
tests
echo "✅ Subdirectories created."
# 3. Create __init__.py files
echo "🐍 Creating __init__.py files..."
touch \
config/__init__.py \
services/__init__.py \
schemas/__init__.py \
utils/__init__.py \
tests/__init__.py
echo "✅ __init__.py files created."
# 4. Create specific Python files and other files
echo "📄 Creating project files..."
touch \
config/settings.py \
services/ai_service.py \
services/embedding_service.py \
schemas/models.py \
schemas/responses.py \
utils/logger.py \
utils/async_helpers.py \
tests/test_ai_service.py \
tests/test_embeddings.py \
main.py \
requirements.txt \
README.md
echo "✅ Project files created."
# Add some basic content to README.md (optional)
echo "# ${PROJECT_NAME}" > README.md
echo "" >> README.md
echo "This is the main README file for the ${PROJECT_NAME} project." >> README.md
echo "✨ README.md populated with a basic title."
# Add a reminder about requirements.txt (optional)
echo "# Add your project dependencies here" > requirements.txt
echo "# Example: fastapi uvicorn[standard]" >> requirements.txt
echo "✨ requirements.txt populated with a comment."
echo ""
echo "🎉 Project structure for '$PROJECT_NAME' created successfully!"
echo "You are currently inside the '$PROJECT_NAME' directory."
echo "Use 'ls -R' or 'tree' (if installed) to view the structure."
# Go back to the original directory (optional, if you prefer the script to not leave you in the new dir)
# cd ..
exit 0
How to use it:
- Save: Save the code above into a file named
create_project.sh (or any other name ending in .sh).
- Make it executable: Open your terminal and run
chmod +x create_project.sh.
- Run the script: Execute it from the directory where you want the
academic-ai-advisor folder to be created: ./create_project.sh.
After running, you'll find the academic-ai-advisor directory created with all the specified files and subfolders in your current working directory. The script also changes into the newly created project directory and prints a success message.