A production-ready Python CLI application structure using Click or argparse.
cli_tool/
├── src/
│ ├── __init__.py
│ ├── cli.py
│ ├── commands/
│ │ ├── __init__.py
│ │ └── example.py
│ └── utils/
├── tests/
├── setup.py
├── requirements.txt
├── README.md
└── .env.example
# Development mode
pip install -e .
# Or install from requirements
pip install -r requirements.txt
# Using the installed command
mycli --help
mycli command --option value
# Or run directly
python -m src.cli --help
mycli init - Initialize configurationmycli run - Run the main taskmycli config - Manage configuration# Install dev dependencies
pip install -r requirements-dev.txt
# Run tests
pytest tests/
# Run linter
flake8 src/