A production-ready Python CLI project scaffold with modern tooling.
- Typer (modern Click) for CLI argument parsing with auto-generated help
- Rich for beautiful terminal output (tables, progress bars, panels, markdown)
- Pydantic v2 for configuration management
- structlog for structured logging with JSON output
- httpx for async HTTP requests
- pytest with coverage, mocking, and fixtures
- Ruff for linting and formatting
- GitHub Actions CI/CD pipeline
- Makefile for common development tasks
# Create project from template
cookiecutter https://github.com/GoodJobwilliam/python-cli-starter
# Or copy and rename the template manually
# Install dependencies
make install
# Run the CLI
python -m cli hello --name World
# Run tests
make testsrc/
├── cli/
│ ├── __init__.py
│ ├── main.py # CLI entry point
│ └── commands/
│ ├── hello.py # Example command
│ ├── config.py # Config management command
│ └── serve.py # Long-running process example
├── core/
│ ├── __init__.py
│ ├── config.py # Pydantic settings
│ ├── logger.py # Structured logging setup
│ └── client.py # HTTP client wrapper
tests/
├── conftest.py # Fixtures
├── test_hello.py
└── test_config.py
config/
├── default.yaml # Default configuration
└── schema.yaml # Config validation schema
# Show help
cli --help
cli hello --help
# Run with options
cli hello --name Alice --count 3 --formal
# Use configuration file
cli --config config/prod.yaml hello
# Output as JSON
cli --json hello
# Run development server
cli serve --port 8080
# Show version
cli --versionmake install # Install dependencies
make dev # Install with dev dependencies
make test # Run tests
make lint # Run linter
make format # Format code
make clean # Clean build artifacts