pip install "repolens[full]" # everything: build + search + telemetry
# or pick extras: repolens[ast] (graph only, offline), repolens[search] (query only)From the directory that contains your git clones (or a single repo):
repolens initThis 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]--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.
export MISTRAL_API_KEY=…
repolens buildArtifacts 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.
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.gzOr from Python — see the README's Python API section.
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.
Everything except embeddings is offline:
repolens build --skip code --skip docs # sidecar + call graph only
repolens graph impact … # all graph queries work