Uses AI to help understand repositories and their changes.
Project description
repo-guide
Use AI to generate guides to code repositories.
NEO: Can you fly that thing?
TRINITY: Not yet. Tank, I need a pilot program for a military B-212 helicopter. Hurry!
[seconds later ...]
TRINITY: Let's go.— The Matrix (1999)
You can see the output of repo-guide on its own repository at https://wolfmanstout.github.io/repo-guide/. This is automatically generated and published after every release.
NOTE: The guides generated by repo-guide are intended to be complementary to
human-authored documentation, not replacements.
Installation
Install this tool using pip, pipx, or uv tool install, e.g.:
pip install repo-guide
By default it uses Gemini Flash as the AI model, which requires an API
key. You can either set the
LLM_GEMINI_KEY environment variable or install Simon Willison's
LLM command-line tool and use llm keys set gemini
to store your key in a configuration file.
Usage
This tool currently only supports Git repositories and their subdirectories, with some additional features for GitHub repositories (e.g. links to files).
Typical usage:
git clone <github_url> my_repo
cd my_repo
repo-guide .
This will generate a Markdown guide in the generated_docs directory within
my_repo, then run a private MkDocs server at
localhost:8000 to serve the docs. It will show a progress bar as it generates
docs, including how many tokens the model has used (combining input + output).
You can start viewing the docs immediately, and the page will automatically
reload as new docs are generated.
If you kill the server and need to restart it later, by default it will reuse
any previously-generated Markdown files, so you can simply rerun the same
command. You can also add --no-resume to delete and regenerate the files, or
--no-gen to explicitly disable doc generation (e.g. even if a new directory
has been added).
Here are some of the most common flags you may want to use:
--output-dir: Change where the generated docs are written.-vor--verbose: Prints details on doc generation progress instead of a progress bar.--model: Sets the LLM model to use. As of 1/1/2025, the default is Gemini 1.5 Flash, which costs under a dollar for 10 million tokens and has a 1 million token context window, making it a great fit. You can try other Gemini models such asgemini-2.0-flash-exp, or OpenAI models ifOPENAI_API_KEYis set, as supported by simonw/llm and simonw/llm-gemini.--token-budget: Sets an approximate token budget to avoid overspending. Please also consider setting limits in your account. I'm not responsible for any unexpected costs, including due to bugs in this tool.
For a full description of command line flags, run:
repo-guide --help
You can also use:
python -m repo_guide --help
Troubleshooting
If the command fails either due to an error or hitting the token budget, simply
rerun the command and it will resume (unless --no-resume is applied). Most
common model errors (e.g. rate-limiting) should be automatically retried with
exponential backoff. You can --ignore large generated or binary files that
aren't automatically filtered out. If you still hit the model token limit, try
setting --files-token-limit.
LLMs are unpredictable, and the generated Markdown may contain errors and broken links. The system prompt tries to mitigate common issues, but they happen anyways. The only real fix to this will be better models, which will surely come soon.
Development
To contribute to this tool, use uv. The following command will establish the venv and run tests:
uv run pytest
To run repo-guide locally, use:
uv run repo-guide
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 repo_guide-0.4.1.tar.gz.
File metadata
- Download URL: repo_guide-0.4.1.tar.gz
- Upload date:
- Size: 67.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c409ccac1e8ad81c8243569195083458ed1b9203e0f43fabc530248e38a40f88
|
|
| MD5 |
d7d72a174714f855b57ef2c4e40a578b
|
|
| BLAKE2b-256 |
23d8131f6c50166a3135e492efbb5b2a7d9ce9209b46f5a9da360ec43c6134a1
|
Provenance
The following attestation bundles were made for repo_guide-0.4.1.tar.gz:
Publisher:
publish.yml on wolfmanstout/repo-guide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repo_guide-0.4.1.tar.gz -
Subject digest:
c409ccac1e8ad81c8243569195083458ed1b9203e0f43fabc530248e38a40f88 - Sigstore transparency entry: 158862355
- Sigstore integration time:
-
Permalink:
wolfmanstout/repo-guide@832dc896b2dc1545327817181fe4dfbb48982d28 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/wolfmanstout
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@832dc896b2dc1545327817181fe4dfbb48982d28 -
Trigger Event:
release
-
Statement type:
File details
Details for the file repo_guide-0.4.1-py3-none-any.whl.
File metadata
- Download URL: repo_guide-0.4.1-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3464b53850170854f00b472e5760df0334344f68705f5454e22e52aa452683d3
|
|
| MD5 |
d6ea1350482ba78f9738c189276aeba5
|
|
| BLAKE2b-256 |
757a8478c4f97750ab710b97683ea24114cfcbd060f4638d0a09c8a394681f04
|
Provenance
The following attestation bundles were made for repo_guide-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on wolfmanstout/repo-guide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
repo_guide-0.4.1-py3-none-any.whl -
Subject digest:
3464b53850170854f00b472e5760df0334344f68705f5454e22e52aa452683d3 - Sigstore transparency entry: 158862356
- Sigstore integration time:
-
Permalink:
wolfmanstout/repo-guide@832dc896b2dc1545327817181fe4dfbb48982d28 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/wolfmanstout
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@832dc896b2dc1545327817181fe4dfbb48982d28 -
Trigger Event:
release
-
Statement type: