GitHub - ehamiter/ragstrap: Retrieval-augmented generation bootstrapper

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 when Cargo.toml and a src/main.rs (or [[bin]]) are present.
  • --json: Output machine-readable JSON (supported by list and info).

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. Set RAGSTRAP_HOME to override the base directory (e.g. RAGSTRAP_HOME=/tmp/ragstrap).
  • GitHub API rate limits apply; set RAGSTRAP_GITHUB_TOKEN to increase the limit.
  • CLI capture for Rust runs cargo build --release and requires a Rust toolchain.

Setting Github Personal Access Token

  1. Go to https://github.com/settings/tokens
  2. Select "Generate new token" => "Generate new token (classic)"
  3. Set expiration to desired time / No expiration
  4. Check public_repo (Access public repositories)
  5. Generate token