← Todas las plantillas

Comandos tipados, salida enriquecida solo en una terminal, configuración en un único archivo.

Constitution — Python CLI

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the tool. A spec may add rules; it never weakens these.

  1. Typed commands. Commands are Typer functions with type hints and Annotated options, so parsing, validation and help come from the signature. mypy or pyright runs in strict mode in CI.

  2. Rich output only in a terminal. Tables, colours and progress bars use Rich only when stdout is a TTY; piped output is plain text or JSON with --json. NO_COLOR is respected.

  3. Config in one file. Settings live in one TOML file in the platform config directory (from platformdirs), overridable by environment variables and flags in that order. config show prints the effective values and where each came from.

  4. Fast start and clean errors. --help answers in under 300 ms because heavy imports happen inside commands. Expected errors print one clear line and exit non-zero; tracebacks appear only with --debug.

  5. Tested and packaged. Commands are tested with Typer's CliRunner for output and exit codes. The tool is packaged with a pyproject.toml entry point and installs cleanly with pipx or uv tool install.