CLI tool to statically analyze and visualize Click/Typer command trees.
Project description
CLI Dependency Graph
Statically analyze and visualize the structure of Python CLI apps built with Click or Typer.
Features
- Detects
click.Group,click.command, and Typer apps (Typer()) via static AST parsing (no code execution) - CLI commands:
scan <path>: Discover command treeshow: Print ASCII treeexport --format {dot,svg}: Save graph file (planned)
- Renders CLI structure as ASCII (terminal) or DOT/SVG (export)
Installation
pip install .
Usage
1. Scan a Python CLI app
python -m cli_dependency_graph scan example_click_app.py
2. Show the discovered CLI structure
python -m cli_dependency_graph show
3. (Optional) Export the CLI graph
python -m cli_dependency_graph export --format dot --output cli_graph.dot
Example CLI App
import click
@click.group()
def cli():
pass
@cli.command()
def hello():
"""Say hello"""
print("Hello!")
@cli.command()
def goodbye():
"""Say goodbye"""
print("Goodbye!")
if __name__ == "__main__":
cli()
Development
- Source code:
src/cli_dependency_graph/ - Tests:
tests/unit/
Run tests
pytest
Requirements
Contributions welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cli_dependency_graph-0.1.0.tar.gz.
File metadata
- Download URL: cli_dependency_graph-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594500ba86e2f59cd3467490a6b0dd4d98ddd6f6855588e4b15aab441e8ae363
|
|
| MD5 |
fde0c243427bed1596af8a253203a555
|
|
| BLAKE2b-256 |
60b1842064470a9ed3b7a9c8e947e7f5917f87ed17469727e18ea36e2a472a4c
|
File details
Details for the file cli_dependency_graph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cli_dependency_graph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7588f56b153f8bb54a98419b4aaaf5fee6cf0652f126d33f5b24516358425248
|
|
| MD5 |
c1a8912a422dde0ab676a92db31bbee0
|
|
| BLAKE2b-256 |
4287c62420e825adc5b9ef9ce6ffd28971c5a8f8e955041243bfa89c12380c02
|