Describe a Package
Explore a codebase at multiple detail levels depending on your needs.
Basic Usage
This shows a detailed view: module names, public functions with docstrings and type annotations, and classes.
Detail Levels
Shows module names, public function signatures with docstrings, parameters with types, return types, and visibility (🔓/🔒).
Adds docstrings, parameters with types, return types, and visibility (🔓/🔒).
Everything: imports, variables, private symbols, decorators.
AI-optimized format: signatures + first docstring line + __all__ + relative imports. No bodies, no absolute imports.
Budget mode
Use --budget N to limit output to the N highest-ranked symbols:
Ranked Output
Add --rank to sort modules and symbols by PageRank importance:
The most-referenced symbols appear first, making it easy to focus on the core architecture.
Module Filtering
Filter output to specific modules by name (case-insensitive substring match):
# Only core modules
axm-ast describe src/mylib --modules core
# Multiple filters (comma-separated)
axm-ast describe src/mylib --modules core,tools
# Combine with TOC for a focused overview
axm-ast describe src/mylib --detail toc --modules core
JSON Output
Returns a JSON object with full module, function, class, and import data — ready for programmatic consumption.
Inspect a Symbol
For detailed inspection of a symbol within a package, use inspect:
# Inspect a function
axm-ast inspect src/mylib --symbol my_function
# Inspect a class method with source code
axm-ast inspect src/mylib --symbol Calculator.add --source
# JSON output with file + line numbers
axm-ast inspect src/mylib --symbol my_function --json
# Inspect by module name — returns module metadata instead of a symbol
axm-ast inspect src/mylib --symbol core.analyzer --json
When --symbol matches a module name rather than an individual symbol, inspect falls back to returning module-level metadata: kind, functions, classes, symbol_count, docstring, and file. This is useful for a quick overview of a module without running describe.