A CLI tool to automate git worktree and Docker Compose development workflows.
- 🌱 Create isolated development environments using git worktrees
- 🔧 Automatic .env file generation from templates
- 🚢 Smart port allocation to avoid conflicts
- 📁 Centralized worktree management in .sprout/ directory
- 🎨 Beautiful CLI interface with colors and tables
For development:
# Clone the repository
git clone https://github.com/SecDev-Lab/sprout.git
cd sprout
# Install in development mode
pip install -e ".[dev]"
- Create a .env.example template in your project root:
# API Configuration
API_KEY={{ API_KEY }}
API_PORT={{ auto_port() }}
# Database Configuration
DB_HOST=localhost
DB_PORT={{ auto_port() }}
# Example: Docker Compose variables (preserved as-is)
# sprout will NOT process ${...} syntax - it's passed through unchanged
# DB_NAME=${DB_NAME}
- Create a new development environment:
sprout create feature-branch
- Navigate to your new environment:
cd $(sprout path feature-branch)
- Start your services:
Create a new development environment with automated setup.
List all managed development environments with their status.
Remove a development environment (with confirmation prompts).
Get the filesystem path of a development environment.
Show the version of sprout.
sprout supports two types of placeholders in .env.example:
-
Variable Placeholders: {{ VARIABLE_NAME }}
- First: Checks if the variable exists in your environment (e.g., export API_KEY=xxx)
- Then: If not found in environment, prompts for user input
- Example: {{ API_KEY }} will use $API_KEY if set, otherwise asks you to enter it
-
Auto Port Assignment: {{ auto_port() }}
- Automatically assigns available ports
- Avoids conflicts with other sprout environments
- Checks system port availability
-
Docker Compose Syntax (Preserved): ${VARIABLE}
- NOT processed by sprout - passed through as-is
- Useful for Docker Compose variable substitution
- Example: ${DB_NAME:-default} remains unchanged in generated .env
# Set environment variable
export API_KEY="my-secret-key"
# Create sprout environment - API_KEY will be automatically used
sprout create feature-branch
# → API_KEY in .env will be set to "my-secret-key" without prompting
# For unset variables, sprout will prompt
sprout create another-branch
# → Enter a value for 'DATABASE_URL': [user input required]
- Architecture Overview - Design philosophy, architecture, and implementation details
- Detailed Usage Guide - Comprehensive usage examples and troubleshooting
# Install development dependencies
make setup
# Run tests
make test
# Run tests with coverage
make test-cov
# Run linter
make lint
# Format code
make format
# Run type checking
make typecheck
- Python 3.11+
- Git
- Docker Compose (optional, for Docker-based workflows)
See LICENSE file.