skills/python/building-typer-clis/SKILL.md
Build, extend, package, migrate, or test Python CLIs with Typer, including command grammar, typed arguments and options, callbacks and context, command groups, prompts, completion, entry points, and current CliRunner behavior. Use when Typer is chosen or an existing Typer CLI needs changes.
npx skillsauth add narumiruna/agent-skills building-typer-clisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Preserve the public invocation grammar while keeping Typer commands as thin adapters between typed terminal input and ordinary Python functions.
| Need | Read |
| --- | --- |
| Single versus multiple commands, callbacks, context, groups, or help | references/application-architecture.md |
| typing.Annotated, defaults, parameter types, prompts, validation, exits, or value completion | references/parameters-and-runtime.md |
| CliRunner, input, streams, files, errors, help, or entry-point tests | references/testing.md |
| Dependency choice, installed commands, python -m, wheels, shell completion, or Typer migration | references/packaging-and-completion.md |
pyproject.toml, the declared Typer version and Python range, existing invocation examples, entry points, app/callback structure, tests, and repository commands. Do not silently upgrade Typer or redesign the CLI.PROGRAM [ARGS]...; adding a second command, registering a sub-app with app.add_typer(...), or adding an application callback changes it to PROGRAM COMMAND [ARGS].... Treat that transition, command renames, option renames, and moved root options as public-interface changes.typer.Typer() app. Compose domain groups with explicit app.add_typer(sub_app, name="...") names and use an application callback only for genuine root options, initialization, documentation, or a deliberate default action.typing.Annotated with typer.Argument() and typer.Option(). Put static defaults in Python assignments, use default_factory= for dynamic defaults, and let Typer perform supported type conversion and boundary validation.typer.BadParameter for parameter-specific validation, typer.Exit for deliberate termination and exit status, and typer.Abort for an aborted interaction. Translate domain failures at the CLI boundary without exposing tracebacks by default.ctx.resilient_parsing before validation or output.app() for direct scripts, [project.scripts] for installed commands, and package __main__.py for python -m package. Exercise the actual installed command when packaging or shell completion is in scope.typer.testing.CliRunner; test business logic directly.typer through the repository's uv workflow only when missing; do not introduce obsolete Typer packages or extras.Finish with the supported invocation forms exercised, behavior and exit codes covered, packaging checked when applicable, and exact validation evidence reported.
development
Score or compare one or more agent skills across trigger clarity, workflow actionability, safety boundaries, verification rigor, incremental knowledge value, and leanness. Use only when the user explicitly asks for ratings, numerical quality scores, rubric-based scorecards, or scored comparisons; use creating-agent-skills for unscored reviews or revisions.
development
Assess or improve an existing codebase's architecture when the user asks about module boundaries, coupling, scattered ownership, testability, change locality, deep modules, seams, or behavior-preserving structural refactoring. Use for cross-module design rather than ordinary diff review or a confirmed edge-case bug fix.
development
Perform read-only security audits, vulnerability assessments, or threat-focused reviews of diffs, pull requests, code paths, or explicitly scoped repositories when security is the primary objective or acceptance criterion. Use reviewing-code for ordinary review with baseline security coverage and hardening-code-paths for fixing confirmed findings.
development
Run iterative multi-reviewer panels over a code diff, verify their findings, apply explicitly authorized fixes, and re-review the updated change until it passes or reaches a stopping condition. Use when the user asks for a panel loop, multi-model code-review consensus, or a review-fix-re-review cycle.