Skip to content

Latest commit

 

History

History
85 lines (61 loc) · 2.38 KB

File metadata and controls

85 lines (61 loc) · 2.38 KB

Quickstart

1. Install

pip install "repolens[full]"          # everything: build + search + telemetry
# or pick extras: repolens[ast] (graph only, offline), repolens[search] (query only)

2. Scaffold a manifest

From the directory that contains your git clones (or a single repo):

repolens init

This writes repolens.yaml with the git repos it found pre-filled, and every advanced option present but commented. A minimal manifest is three lines:

base_dir: .
repos: [my-repo]
include_ext: [.py, .ts]

3. Estimate before you pay

--dry-run walks, chunks, and counts — zero API calls:

$ repolens build --dry-run
[repolens] ./.repolens — code: 5842 files, 38712 chunks, ~33.10 M tokens (dry-run)

At Mistral's codestral-embed pricing (~$0.15/M tokens) that full first index is ~$5; a typical single-repo project is cents. Incremental rebuilds only re-embed files whose sha256 changed, so the steady-state cost is near zero.

4. Build

export MISTRAL_API_KEY=…
repolens build

Artifacts land in the manifest's output.dir (default ./.repolens):

.repolens/
├── lancedb/          # vector store: code_chunks (+ docs_chunks) tables
├── graph.json.gz     # static call graph
└── meta.json         # per-file authority/recency sidecar (git-derived)

Interrupted build? Just re-run: files already written are skipped.

5. Query

repolens search "where do we throttle outbound API calls?" --k 5
repolens search "cache invalidation" --repo backend --lang py --since 2025-01-01
repolens graph impact  --graph .repolens/graph.json.gz PaymentService --direction callers
repolens graph hotspots --graph .repolens/graph.json.gz --top 20
repolens graph path    --graph .repolens/graph.json.gz handler fetch_user
repolens graph dead    --graph .repolens/graph.json.gz

Or from Python — see the README's Python API section.

6. Keep it fresh

The build is idempotent and incremental, so automation is one line in any scheduler — recipes for cron, systemd timers and GitHub Actions are in pipelines.md. To serve the index to an AI agent over MCP, see mcp.md.

Working without an API key

Everything except embeddings is offline:

repolens build --skip code --skip docs    # sidecar + call graph only
repolens graph impact …                   # all graph queries work