Project rules
Python CLI Rules
Project rules for Python command line tools: argparse or Typer, clear exit codes, pyproject packaging, stderr logging and pytest.
CLAUDE.md
1Layout and packaging
2- Use a `src/<package>` layout and `pyproject.toml` with a `[project.scripts]` entry point. Keep `cli.py` thin; put logic in importable modules that take plain arguments.
3- Pin the supported Python range and type-hint public functions. Run `mypy` or `pyright` in strict mode.
4Arguments and I/O
5- Parse with `argparse` or Typer, never `sys.argv` by hand. Every option has help text; offer `--version` and `--help`.
python
#
Python CLI Rules
Project rulespython
Free