Quick Start
This tutorial walks you through installing axm-ast and exploring a Python project.
Prerequisites
- Python 3.12+
- uv (recommended) or pip
Installation
Or with pip:
Verify the installation:
Step 1: Get Project Context
The context command gives an AI agent everything it needs in one call:
๐ mylib
layout: src (16 modules, 151 functions, 9 classes)
python: >=3.12
๐ง Stack
cli: cyclopts models: pydantic tests: pytest
lint: ruff types: mypy packaging: hatchling
๐ AXM Tools
axm-ast: โ
๐ Patterns
exports: __all__ in 13 modules
tests: 12 test files
๐ฆ Modules (ranked)
cli โ
โ
โ
โ
โ
(describe, inspect, graph, search, callers...)
core.analyzer โ
โ
โ
โ
โ (analyze_package, build_import_graph...)
core.docs โ
โ
โ
โโ (discover_docs, build_docs_tree...)
JSON output
Add --json to any command for machine-readable output.
Step 2: Describe the Package
Get a detailed view of all symbols:
Or a compressed AI-friendly view:
The compressed view shows only signatures, first docstring lines, __all__, and relative imports โ ideal for fitting into LLM context windows.
Step 3: Visualize the Dependency Graph
graph TD
cli["cli"]
core_analyzer["core.analyzer"]
core_parser["core.parser"]
models_nodes["models.nodes"]
cli --> core_analyzer
core_analyzer --> core_parser
core_analyzer --> models_nodes
Step 4: Find Who Calls a Function
๐ 7 caller(s) of 'analyze_package':
cli:89 in describe()
analyze_package(project_path)
cli:272 in graph()
analyze_package(project_path)
core.context:246 in build_context()
analyze_package(path)
core.impact:203 in analyze_impact()
analyze_package(path)
Step 5: Analyze Change Impact
Before modifying a function, check the blast radius:
๐ฅ Impact analysis for 'analyze_package' โ HIGH
๐ Defined in: core.analyzer (L38)
๐ Direct callers (7): cli, core.context, core.impact
๐ Affected modules (5): axm_ast, cli, core, core.context, core.impact
๐งช Tests to rerun (7): test_analyzer, test_callers, test_compress...
๐ฆ Re-exported in (5): axm_ast, cli, core, core.context, core.impact
Step 6: Dump Documentation
Get the full documentation tree in one call:
๐ README.md
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# mylib
Python AST introspection CLI...
๐ Documentation tree
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
docs/
โโโ howto
โ โโโ describe.md
โโโ tutorials
โ โโโ quickstart.md
โโโ index.md
๐ docs/index.md
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Home
...
Tree-only mode
Use --tree to quickly see the documentation structure without file contents.
Next Steps
- Describe a package โ All detail levels and output formats
- Analyze change impact โ Pre-refactoring risk assessment
- How-To Guides โ Advanced usage patterns
- CLI Reference โ Full command documentation
- Architecture โ How it works under the hood