Create or extend Python command-line interfaces using Typer and wire them into pyproject.toml entry points. Use when asked to add a new CLI, add a subcommand, or expose a console script for a Python package, especially when pyproject.toml needs [project.scripts] updates or an empty directory needs full project initialization.
Create a Python CLI module and expose it via pyproject.toml console scripts while matching existing project conventions.
pyproject.toml is created by Hatch and reflects the package name.Commands to run (replace my-cli with the desired name):
uv venv --python 3.13 .venv
source .venv/bin/activate
uv pip install hatch
hatch new my-cli
pyproject.toml to detect packaging style ([project], [tool.poetry], [tool.hatch], existing scripts).src/ vs flat) and any existing CLI modules or patterns.atlas-trigger dataset list) to infer subcommands and nesting.--help remains fast.main() entry point (returning an exit code).main().app = typer.Typer() and invoke app() inside main() or use typer.run(main) for single-command CLIs.hello from <command> using the full command path (e.g., hello from atlas-trigger dataset list).[project.scripts]:
my-cli = "package.module:main"pyproject.toml (add it if missing).python -m package --help and the example command to verify the dummy output.acme and add it to pyproject.toml."status subcommand to the existing CLI and wire it up."package.cli:main as a console script in this project."