CLInspector
CLInspector introspects Python CLI applications and returns their command tree
(commands, subcommands, options and arguments) as plain, framework-independent
dataclasses. Use it to generate CLI documentation, build completions or wrappers,
or analyze CLI interfaces without parsing --help output.
Installation
pip install clinspector
Framework support is optional; install the extras for the frameworks you use:
pip install "clinspector[click]" # or: typer, cleo, cappa, cyclopts
pip install "clinspector[all]" # click, typer, cappa and cleo
pip install "clinspector[markdown]" # Markdown rendering (jinja2)
Quickstart
import click
from clinspector import get_cmd_info
@click.group()
@click.option("-v", "--verbose", is_flag=True, help="Enable verbose output")
def cli(verbose: bool) -> None:
"""Example CLI tool."""
@cli.command()
@click.argument("target")
@click.option("--release", is_flag=True, help="Build in release mode")
def build(target: str, release: bool) -> None:
"""Build the project."""
info = get_cmd_info(cli)
print(info.name, "-", info.description) # cli - Example CLI tool.
for param in info.params:
print(param.opts, param.help) # ['-v', '--verbose'] Enable verbose output, ...
build_info = info["build"] # subcommands via item access
print(build_info.full_command) # cli build
print([p.name for p in build_info.params]) # ['target', 'release', ...]
Supported frameworks
get_cmd_info(instance, command=None) accepts:
- Typer:
typer.Typerinstances - Click:
click.Groupinstances - Cleo:
cleo.application.Applicationinstances - Cappa: classes decorated with
@cappa.command - Cyclopts:
cyclopts.Appinstances - argparse:
ArgumentParserinstances
Pass command to get a specific subcommand directly (argparse also accepts dot
notation like "group.sub"). It returns None for unsupported objects.
Data model
CommandInfo (clinspector.CommandInfo):
name,description,usage,epilogparams: list[Param]subcommands: dict[str, CommandInfo](also reachable viainfo["name"])deprecated,hidden,callbackfull_path/full_command: the command path including parentsbuild_cli_command(),execute_cli(),execute_shell(): run the command as a subprocess
Param (clinspector.Param), among others:
name,help,default,opts(e.g.["-f", "--flag"]),secondary_optsrequired,is_flag,multiple,nargs,choices,metavarenvvar,hidden,type,param_type_name("option","argument", ...)
More features
- Markdown docs:
clinspector.introspect.markdown.get_cmd_markdown(instance, command=None, include_subcommands=False)renders a command as Markdown (markdownextra). - Synthesis: create a CLI from a
CommandInfo, e.g.clinspector.synthesis.synth_click.create_group,synth_typer.create_app,synth_cleo.create_app,synth_argparse.create_parser. - Help providers: async lookups of command examples from tldr pages
(
clinspector.help_providers.tldr_pages.TldrProvider,tldrextra) and man pages (clinspector.help_providers.man_pages.ManPageProvider).
Metadata
Release files for clinspector 1.0.5
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 | Actions |
|---|---|---|---|---|
| clinspector-1.0.5.tar.gz | 26.7 kB | With provenance | Details for clinspector-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clinspector-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for clinspector-1.0.5-py3-none-any.whl |
Total release size: 61.0 kB
Release files / clinspector-1.0.5.tar.gz
| Download URL | clinspector-1.0.5.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e25a94e70a51beaf55fa2644cc6db41151682388201959489d0730d7e0464438
|
|
BLAKE2b-256 checksum How to use checksums |
5419bd6d8cafdb6da7047a4949f1a2eb1ba781d6f7d5fff751ee2f89caca0ffc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logRelease files / clinspector-1.0.5-py3-none-any.whl
| Download URL | clinspector-1.0.5-py3-none-any.whl |
|---|---|
| Size | 34.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e2e763094505b0a0f2ab16a6d5f7e83e976b67092485c450ed3f79384f038da
|
|
BLAKE2b-256 checksum How to use checksums |
5a5c14fd2574efa8889637b387b1057c86d102d84323b4f5c693756400d3ea19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 22, 2026.
Transparency logSecurity for clinspector 1.0.5
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
Both files in this release have been uploaded with provenance metadata.
Attestation for clinspector-1.0.5.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 Nov 22, 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.