ragstrap is a CLI that builds local reference snapshots from GitHub repositories for
RAG workflows. It downloads the repo archive into ~/.ragstrap/references/<name>/raw,
records metadata, generates an index.md, and can optionally capture --help output
for Rust CLIs. References are stored in a shared location so multiple projects can
reuse the same snapshots without duplicating disk space.
Install (preferred)
Install from source
git clone https://github.com/erichamiter/ragstrap.git cd ragstrap uv tool install -e .
Usage
ragstrap fetch https://github.com/OWNER/REPO
Other commands:
ragstrap list ragstrap info <name> ragstrap update <name>
Common flags:
--name/-n: Name the reference directory (defaults to the repo name).--force/-f: Overwrite an existing reference directory.--capture-cli/--no-capture-cli: Capture CLI help output; auto-enabled for Rust CLIs whenCargo.tomland asrc/main.rs(or[[bin]]) are present.--json: Output machine-readable JSON (supported bylistandinfo).
Output layout
~/.ragstrap/references/<name>/
meta.json
index.md
raw/...
cli/ (optional help output)
Notes
- Python >= 3.9 is required.
- References are stored in
~/.ragstrap/references/by default. SetRAGSTRAP_HOMEto override the base directory (e.g.RAGSTRAP_HOME=/tmp/ragstrap). - GitHub API rate limits apply; set
RAGSTRAP_GITHUB_TOKENto increase the limit. - CLI capture for Rust runs
cargo build --releaseand requires a Rust toolchain.
Setting Github Personal Access Token
- Go to https://github.com/settings/tokens
- Select "Generate new token" => "Generate new token (classic)"
- Set expiration to desired time / No expiration
- Check
public_repo(Access public repositories) - Generate token