← ClaudeAtlas

python-clilisted

Use when writing or changing a Python command-line interface — a CLI tool, or a command added to a service of either family — its commands and their arguments, the exit code each outcome leaves, and the test that invokes them. Owns the thin command that parses its arguments, calls one ordinary typed function and renders its result, the exit-code map written once at the boundary with success alone at zero, every catalogue failure on a non-zero code of its own and an unexpected exception keeping its traceback, commands that never import one another, the command line as the tool's published surface, and the in-process test through the library's runner asserting the exit code and the output as literals; bound to typer. Settings, the output and log streams, the console-script declaration and the error classes stay with `python-settings`, `python-logging`, `python-toolchain` and `exception-catalog`; whether a CLI tool takes an architecture family is `architecture-choice`.
wntic/pyhouse · ★ 3 · AI & Automation · score 76
Install: claude install-skill wntic/pyhouse
# Python CLI — commands, exit codes and their test A command-line interface is a boundary like any other: arguments come in as strings, a result and an exit code go out, and everything between is ordinary typed code that knows nothing about the command line. This skill owns that boundary — the command, the exit-code map and the test that drives it — for a CLI tool and for a command added to a service. It gives no package layout for a large command tree. ## When to use vs. neighbours - Whether a CLI tool takes the hex or the flat family → `architecture-choice`; it takes neither, and this skill is what binds its commands. - The settings a command builds, a dotenv file, a tunable's default, an argument versus a setting → `python-settings` (rules 2, 5, 13 and 15). - What goes to stdout and what to stderr, and where logging is configured → `python-logging`. - Declaring the console script, the src layout, the lint and type-check configuration → `python-toolchain`. - The error classes, their `code` and `context`, and rendering a caught error in one place → `exception-catalog`. - What a test asserts, the substitution ladder, the entrypoint layer's budget → `test-principles`. - A CLI tool shipped as an image rather than a package → `python-container-image`. - The run a command triggers in a flat service, or the handler it calls in a hexagonal one → the family's own skill, e.g. `flat-entrypoint` (in the `pyhouse-flat` plugin) or `hex-application` (in `pyhouse-hex`); the