ast-bro
PyPI installer for ast-bro — a fast, AST-based code-navigation toolkit for source files (shape, public API, dep & call graphs, hybrid semantic search, structural rewrite, MCP server). Downloads the pre-built Rust binary on first run.
Formerly
ast-outline-cli. Same project under a new name (theast-outlinename became overloaded after the tool grew beyond outlining). Theast-outlinecommand is still installed as a thin proxy that forwards toast-bro, so existing scripts keep working.
Install
pip install ast-bro
For an isolated tool installation, use uv tool install ast-bro. Both commands work on Windows x64 with Python 3.8+; no Rust toolchain is needed.
This installs three commands, all forwarding to the same binary:
ast-bro— canonical namesb— short alias (same tool, fewer keystrokes)ast-outline— backward-compat shim
Usage
# Map the structure of a file (signatures + line ranges, no bodies)
ast-bro map src/player.rs
# Show the exact source of a specific method
ast-bro show Player.cs TakeDamage
# Compact digest of a whole module
ast-bro digest src/services/
# True public API (resolves pub use / __all__ re-exports)
ast-bro surface .
# Find all implementations of a type
ast-bro implements IDamageable src/
# Dependency graph
ast-bro deps src/auth.rs --depth 2
ast-bro reverse-deps src/auth.rs
ast-bro cycles
# Call graph (AST-accurate)
ast-bro callers TakeDamage
ast-bro callees Player.TakeDamage
# Hybrid BM25 + dense semantic search
ast-bro search "how does login work"
# Find semantically similar code
ast-bro find-related src/auth/login.rs:42
# AST-aware structural search and rewrite (with metavariables)
ast-bro run -p '$FUNC($$$)' -l rust
ast-bro run -p 'foo($A)' -r 'bar($A)' --write # apply to disk
On first run, the CLI downloads the pre-built binary for your platform from GitHub releases and caches it locally.
| Platform | Cache directory |
|---|---|
| macOS | ~/Library/Caches/ast-bro/<version>/ |
| Linux | ~/.cache/ast-bro/<version>/ |
| Windows | %LOCALAPPDATA%\ast-bro\Cache\<version>\ |
Supported Platforms
| Platform | Status |
|---|---|
| macOS ARM64 | Pre-built binary available |
| Windows x64 (Windows 10/11) | Pre-built binary available |
| Windows ARM64 | Build from source |
| Other platforms | Build from source (see below) |
For unsupported platforms, build from source:
cargo install ast-bro
What is ast-bro?
ast-bro is a fast, AST-based code-navigation toolkit built for LLM coding agents and humans. It uses tree-sitter via ast-grep to parse source files and provide:
- File shape —
map/digest/showfor signatures with line ranges (95% token savings vs reading full files) - True public API —
surfaceresolves re-export graphs across Rust, Python, TypeScript, and more - Dependency graph —
deps/reverse-deps/cycles/graphfor import analysis - Call graph —
callers/calleeswith AST accuracy across 14 languages (not Elixir yet) - Semantic search — hybrid BM25 + dense embeddings via
searchandfind-related - Structural rewrite —
runfor AST-aware pattern matching with metavariables (find + replace) - MCP server — every command exposed as an MCP tool for LLM agents
Supports Rust, Python, TypeScript, JavaScript, Java, C#, C++, Kotlin, Scala, Go, PHP, Ruby, Elixir, SQL, and Markdown.
Links
- ast-bro source code
- npm package (Node.js installer)
- crates.io (Rust library)
License
Metadata
Release files for ast-bro 4.5.0
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 |
|---|---|---|---|---|
| ast_bro-4.5.0.tar.gz | 6.7 kB | Without provenance | Details for ast_bro-4.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ast_bro-4.5.0-py3-none-any.whl | Python 3 | none | any | Details for ast_bro-4.5.0-py3-none-any.whl |
Total release size: 12.1 kB
Release files / ast_bro-4.5.0.tar.gz
| Download URL | ast_bro-4.5.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
086e682f7e59259b91f587272046992f5c0e209433c5061315730aa54b20a791
|
|
BLAKE2b-256 checksum How to use checksums |
b42218c9fe8e08660fb1fe3c15c2e5dc4a7ea42212a2c939ef61c48ad332b93d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Release files / ast_bro-4.5.0-py3-none-any.whl
| Download URL | ast_bro-4.5.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
920cbfc6b041107cdb5b809e96cdea286b3e01413830224cb6d725aa7c18a530
|
|
BLAKE2b-256 checksum How to use checksums |
0a8870d7e6d46f7c5a53eff7ed90d5537bace6c4b0bddaca46b5a49157d6715b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Security for ast-bro 4.5.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.