CLInspector
CLInspector Documentation
CLInspector is a library to introspect Python CLI applications and extract their command structure and parameters programmatically.
Usage
The main entry point is the get_cmd_info() function which analyzes a CLI application instance and returns a structured CommandInfo object:
from clinspector import get_cmd_info
command_info = get_cmd_info(cli_instance)
The function accepts CLI application instances from the following frameworks:
- Typer -
typer.Typerinstances - Click -
click.Groupinstances - Cleo -
cleo.Applicationinstances - Cappa - Classes decorated with
@cappa.command - argparse -
ArgumentParserinstances
The extracted information is returned as a CommandInfo object containing:
CommandInfo Fields
name: str- Name of the commanddescription: str- Description/help textusage: str- Formatted usage stringsubcommands: dict[str, CommandInfo]- Nested subcommandsdeprecated: bool- Whether command is marked as deprecatedepilog: str | None- Optional epilog texthidden: bool- Whether command is hiddenparams: list[Param]- List of command parameters
Param Fields
name: str- Parameter namehelp: str | None- Help textdefault: Any- Default valueopts: list[str]- Parameter options (e.g.["-f", "--flag"])required: bool- Whether parameter is requiredis_flag: bool- Whether parameter is a flagmultiple: bool- Whether parameter accepts multiple valuesnargs: int | str | None- Number of arguments acceptedenvvar: str | None- Environment variable namehidden: bool- Whether parameter is hiddenparam_type_name: Literal["option", "parameter", "argument"]- Parameter typetype: dict[str, str] | None- Parameter type informationmetavar: str | None- Display name in help text
You can access subcommands using dictionary syntax:
# Get info for "build" subcommand
build_info = command_info["build"]
# Access nested subcommand
nested_info = command_info["group"]["subcommand"]
The extracted information allows you to:
- Generate documentation automatically
- Build command completion
- Create wrappers and adapters
- Perform static analysis of CLI interfaces
- And more!
Example output for a click command:
```python
CommandInfo(
name="cli",
description="Example CLI tool",
usage="cli [OPTIONS] COMMAND [ARGS]...",
params=[
Param(name="verbose", help="Enable verbose output", opts=["-v", "--verbose"])
],
subcommands={
"build": CommandInfo(
name="build",
description="Build the project",
params=[...]
)
}
)
Metadata
Release files for clinspector 1.0.1
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.1.tar.gz | 23.1 kB | With provenance | Details for clinspector-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clinspector-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for clinspector-1.0.1-py3-none-any.whl |
Total release size: 56.2 kB
Release files / clinspector-1.0.1.tar.gz
| Download URL | clinspector-1.0.1.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2854ea75c8b70c4a1c5273dcb9d44497e8a29c0d4d9dcb7299e551ac20e0c99a
|
|
BLAKE2b-256 checksum How to use checksums |
2eda5523bbfb94a8f961b7ee998fcbdf3efdeea14225c848f35e520383d35369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 9, 2025.
Transparency logRelease files / clinspector-1.0.1-py3-none-any.whl
| Download URL | clinspector-1.0.1-py3-none-any.whl |
|---|---|
| Size | 33.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67616bbbb6e5c7a50a5e7760c0a6022ca31f612910aab21770296513e4a98492
|
|
BLAKE2b-256 checksum How to use checksums |
0e06c8508a6a7b8dfa1600c57e2227194ffc0877958b1bf97bc0e2985b360c7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 9, 2025.
Transparency logSecurity for clinspector 1.0.1
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 clinspector-1.0.1.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 9, 2025.
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.