repomap
Tree-sitter based repository map generator - extract and visualize code structure using PageRank.
Installation
From source (using uv)
git clone https://github.com/cdpath/repomap
cd repomap
uv tool install .
From source (using pip)
git clone https://github.com/cdpath/repomap
cd repomap
pip install .
Usage
Generate a Repo Map
# Basic usage
repomap ./src
# Filter by language
repomap ./src --language python
# Exclude directories
repomap ./src --exclude tests
# Save to file
repomap ./src -o map.md
# Adjust output size
repomap ./src --tokens 8192
Generate a Call Graph
# Generate call graph from entry point
repomap ./src --graph graph.png --entry main.py
# Limit traversal depth
repomap ./src --graph graph.png --entry main.py --depth 2
# JSON output (FASTEN adjacency list format)
repomap ./src --graph graph.json --entry main.py
# Focus on files matching a pattern (shows matching files + their neighbors)
repomap ./src --graph graph.dot --focus core
Example call graph:
JSON formats:
| Filename | Format |
|---|---|
graph.json |
Simple adjacency list |
graph.fasten.json |
FASTEN format |
Simple JSON:
{"cli.py": ["core.py", "graph.py"], "core.py": ["ranking.py"]}
{"product": "myproject", "graph": {"internalCalls": [["cli.py", "core.py"]]}, ...}
Options
--output, -o FILE Save repo map to file
--graph, -g FILE Generate call graph (.png, .svg, .pdf, .dot, .json)
--entry FILE Entry point file - filter to reachable files only
--depth N Max depth from entry point (default: unlimited)
--min-refs N Min references for symbol inclusion (default: 1)
--focus PATTERN Focus graph on files matching pattern
--exclude, -e PATTERN Exclude paths matching pattern
--language, -l LANG Filter by language (python, javascript, etc.)
--tokens, -t TOKENS Max tokens for repo map (default: 4096)
--verbose, -v Enable verbose output
Default Excludes
Common directories are automatically excluded: .venv, node_modules, __pycache__, .git, dist, build, etc.
Supported Languages
30+ languages via tree-sitter: Python, JavaScript, TypeScript, Java, Go, Rust, C/C++, C#, Ruby, and more.
How It Works
- Parse source files using tree-sitter to extract definitions and references
- Build a graph of file interdependencies
- Rank using PageRank algorithm to identify most important code
- Render as tree-structured markdown or visual call graph
Example Repo Map Output
core.py:
│class RepoMap:
│ def __init__(...)
│ def get_repo_map(...)
ranking.py:
│def get_ranked_tags(...)
│def _get_tags_cached(...)
Attribution
Derived from aider's repomap by Paul Gauthier. See NOTICE.
License
Apache 2.0 - see LICENSE
Metadata
Release files for pyrepomap 0.1.4
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 | |
|---|---|---|---|---|
| pyrepomap-0.1.4.tar.gz | 188.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrepomap-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 228.5 kB
Release files / pyrepomap-0.1.4.tar.gz
| Download URL | pyrepomap-0.1.4.tar.gz |
|---|---|
| Size | 188.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aad07fc316e314baed03c2ea4ceb26e2a5f779ab82261cfe87ba517f9086bb6b
|
|
BLAKE2b-256 checksum How to use checksums |
4d541af608bddc07c21eb8f4e8b7c46a3e6fc64dc51b3cd4ffbdbd4c37bd5232
|
| 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 Dec 18, 2025.
Transparency logRelease files / pyrepomap-0.1.4-py3-none-any.whl
| Download URL | pyrepomap-0.1.4-py3-none-any.whl |
|---|---|
| Size | 40.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
772771baf2088212059c7cf039e7257ca540182905bdf80b342ceaf8fb5119e4
|
|
BLAKE2b-256 checksum How to use checksums |
db7f493e7dc8dbaac942d7ab10b49476406c770d46167f588fcf03d4b894f279
|
| 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 Dec 18, 2025.
Transparency logSecurity for pyrepomap 0.1.4
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 pyrepomap-0.1.4.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 Dec 18, 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.