typer-cli

A set of guidelines for adding command-line commands with Typer, a Python library for building terminal applications. It defines where commands belong and how asynchronous functions are run from them.

In plain words
What is it for?
Adding subcommands, organizing command groups, exposing scripts to users, and connecting asynchronous database or network operations to the command line.
Why use it?
It gives users one consistent command-line entry point and prevents async application code from being wired incorrectly to synchronous terminal commands.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tedivm/robs_awesome_python_template/typer-cli
Any agent
npx skills add tedivm/robs_awesome_python_template --skill typer-cli
Clone the repo
git clone --depth 1 https://github.com/tedivm/robs_awesome_python_template

Made for: Claude Code, Codex.

Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,269 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.01269
Opus 5 $0.00023 $0.00634
Sonnet 5 $0.00009 $0.00254
Haiku 4.5 $0.00005 $0.00127

Measured 2d ago against content hash 2ec7f35cee33, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

typer-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

{{cookiecutter.__package_slug}}/.agents/skills/typer-cli/SKILL.md · 157 lines

How it starts

The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Typer CLI

context7: If documentation tools are available, resolve and load the full typer documentation before making any changes to the CLI system:

context7_resolve-library-id: "typer"
context7_query-docs: <resolved-id> "your query here"

Any command or script that must be accessible to users must be exposed through the Typer library.

For full developer documentation see docs/dev/cli.md.


CLI Structure

The CLI is registered in pyproject.toml as a project script pointing to {{cookiecutter.__package_slug}}.cli:app.

The main app is defined in {{cookiecutter.__package_slug}}/cli.py. Domain-specific subcommand groups live in separate {{cookiecutter.__package_slug}}/cli_<domain>.py files and are mounted onto the main app.


Async Commands — @syncify

Typer runs commands synchronously, but this project uses async throughout (database access, HTTP calls, etc.). Use the @syncify decorator from {{cookiecutter.__package_slug}}/cli.py to bridge them:

from {{cookiecutter.__package_slug}}.cli import syncify

@app.command()
@syncify
async def my_command(name: str) -> None:
    """This async function will run correctly from the CLI."""
    result = await some_async_operation(name)
    typer.echo(result)

Critical: @app.command() must appear before @syncify in decorator order. Do not use asyncio.run() directly — syncify handles the event loop correctly.


{%- if cookiecutter.include_sqlalchemy == "y" %}

Database Access in CLI Commands

Use get_session from {{cookiecutter.__package_slug}}.services.db for database-backed commands. Always use it as an async context manager:

from {{cookiecutter.__package_slug}}.services.db import get_session

@app.command()
@syncify
async def my_db_command() -> None:
    """Example command using database access."""
    async with get_session() as session:
        result = await session.execute(select(MyModel))
        items = result.scalars().all()
        for item in items:
            typer.echo(item.name)

Read the full file on GitHub · 157 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 157 lines · 47 tokens per session scan A 2ec7f35cee33

Subscribe to this mod's changes

typer-cli is a skill published in the GitHub repository tedivm/robs_awesome_python_template (309 stars, last pushed 3mo ago), licensed MIT. It adds 47 tokens to every session and 1,269 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

background-task

Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.backgroundtasks }}.

vstorm-co/full-stack-ai-agent-template · 62 tokens

agent-tool

Add a new tool/function the AI agent can call (e.g. look something up, hit an external API, perform an action). Use when extending the assistant's capabilities, wiring a new function into the agent, or when the model needs a new action. This project uses {{ cookiecutter.aiframework }}.

vstorm-co/full-stack-ai-agent-template · 66 tokens

frontend-feature

Build a new page, view, or data-driven feature in the Next.js frontend. Use when adding a route under the dashboard/marketing area, wiring UI to a backend endpoint, adding client state, or creating a localized page. Covers App Router, data fetching, Zustand stores, and i18n.

vstorm-co/full-stack-ai-agent-template · 64 tokens

rag-knowledge

Work with the RAG knowledge base — ingest documents, run semantic search, manage collections, or add a sync source/connector (Google Drive, S3). Use when populating or debugging the knowledge base, tuning retrieval, or adding a new document source. This project uses {{ cookiecutter.vectorstore }} + {{…

vstorm-co/full-stack-ai-agent-template · 76 tokens

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

channel-bot

Work with messaging-channel bots (Telegram / Slack) — register a bot, route inbound messages through the AI agent, handle webhooks vs polling, or add a new channel adapter. Use when wiring chat into a messaging platform or debugging bot delivery.

vstorm-co/full-stack-ai-agent-template · 53 tokens