Typer Cheatsheet Command
A pluggable cheatsheet command for your Typer applications to visualize their command tree structure.
This library provides a cheatsheet subcommand that you can easily integrate into any existing Typer application. It automatically inspects your Typer application and its subcommands/groups to generate a clear, tree-like representation, making it easier for users to understand available commands.
It traverses the command tree generated by Typer and can also emit a versioned JSON description with command parameters for agents and tooling.
Installation
You can install this library directly from GitHub using uv
uv add git+https://github.com/mgaitan/typer-cheatsheet-command.git
Demo
You can run the demo application included in this repository to see the cheatsheet command in action:
uvx typer-cheatsheet-command cheatsheet
This will output a tree structure of the demo (dummy) application's commands:
Integrating into your Typer application
To add the cheatsheet command to your own Typer application, simply import the register_cheatsheet_command function and call it with your typer.Typer instance.
First, ensure typer-cheatsheet-command is installed in your project's environment.
Then, in your main application file (e.g., main.py):
# main.py
import typer
from typer_cheatsheet_command.cheatsheet_command import register_cheatsheet_command
app = typer.Typer(name="MyCoolApp", help="A cool command-line application.")
@app.command()
def hello(name: str = "World"):
"""Say hello to someone."""
print(f"Hello {name}!")
users_app = typer.Typer(help="Manage users.")
@users_app.command("create")
def create_user(username: str):
"""Creates a new user."""
print(f"Creating user {username}")
app.add_typer(users_app, name="users")
# Register the cheatsheet command
register_cheatsheet_command(app)
if __name__ == "__main__":
app()
Now, when you run your application, the cheatsheet command will be available:
uv run main.py cheatsheet
This would produce an output similar to:
╭─ Cheatsheet ───────────────────────────────────────────────────────────────╮
│ MyCoolApp │
│ ├── hello: Say hello to someone. │
│ ├── cheatsheet: Show the command tree structure of the application. │
│ └── users: Manage users. │
│ └── create: Creates a new user. │
╰────────────────────────────────────────────────────────────────────────────╯
By default, the command is registered as cheatsheet. If you want to use a different name for the subcommand, you can set it explicitly
register_cheatsheet_command(app, command_name="cheat")
The command description is configurable and may contain multiple lines:
register_cheatsheet_command(
app,
description="""Show every available command.
Includes nested groups and their parameters.
""",
)
JSON output
Use JSON when another program needs to discover commands, options, arguments, and nested groups:
uv run main.py cheatsheet --output json
Hidden commands are excluded by default. Pass --show-all to include them in either output format.
The same data is available from Python without registering a command:
from typer_cheatsheet_command import get_command_tree
command_tree = get_command_tree(app)
Metadata
Release files for typer-cheatsheet-command 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| typer_cheatsheet_command-0.2.0.tar.gz | 5.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| typer_cheatsheet_command-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.1 kB
Release files / typer_cheatsheet_command-0.2.0.tar.gz
| Download URL | typer_cheatsheet_command-0.2.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cff400e74f2fdc1952be2fa2fe43326cb7e8286a1ab60ad0a9d6a7c57b7f6d72
|
|
BLAKE2b-256 checksum How to use checksums |
eb96ad4aee9853e2afe39fca56063b126f32eca9763564ab9fb4fe91fb98a513
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logRelease files / typer_cheatsheet_command-0.2.0-py3-none-any.whl
| Download URL | typer_cheatsheet_command-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dbc0b466e955cc920921fce441e49f476839d79359aaf61407cb0cb573a053d
|
|
BLAKE2b-256 checksum How to use checksums |
1d34b06b9e6f6874a2155e6ea5455298e9d4f66617a6e0ef1999780027c708b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logSecurity for typer-cheatsheet-command 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for typer_cheatsheet_command-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.