cli-packaging-patterns
Installation
SKILL.md
CLI Packaging & Distribution
The Pattern
Problem: You want a CLI tool that installs cleanly from a git URL with zero manual steps — no cloning, no virtual env, no PATH fiddling.
Approach: Combine pyproject.toml [project.scripts] with hatchling build backend, a __main__.py dual entry point, and argparse with a default-action subcommand design so mytool and mytool serve do the same thing.
Pattern proven in production across multiple Python CLI tools and web services.
When this skill is NOT the right answer
This skill assumes a pure Python CLI distributed via uv tool install. If your project does not fit that profile, use a different pattern: