Universal CLI for repository operations — lint, format, build, and test across multiple programming languages, with auto-detection.
- Auto-detection: detects project types (Node.js, Python, Rust, Go, JVM)
- Cross-language commands:
lint,fmt,build,testwork across all detected projects - Context gathering:
context— AI-ready repo overview (git, structure, symbols, TODOs, optional analysis/audit) - Mix: pack a repo into one AI-friendly file via
repomix
repo lint # check light linters
repo --full lint # all linters (including heavy ones)
repo lint --fix # auto-fix where available
repo lint --list # list detected linters without running
repo lint -t rust # only a specific project type
repo fmt # apply formatting
repo fmt --check # check only (CI)
repo build # build all detected projects
repo build --check # faster checks (cosmetic header only)
repo test # run all tests (always "full" mode)
repo test --coverage # with coverage (if supported)
repo test --watch # watch mode (if supported)
repo mix # repomix passthroughrepo index / repo search build and query a local, definition-aware code index:
- File discovery respects
.gitignore/.ignorerules, skips hidden entries, and caps file size at 1 MiB (theignorewalker — norgsubprocess). The same walker feeds the search index, the symbol store, andcontext. - Chunks are definition-aligned (tree-sitter): one chunk per top-level symbol, with the symbol breadcrumb ranked into the token stream. Languages without a grammar fall back to overlapping line windows.
- Indexing is incremental: an mtime diff re-chunks only changed, added, or
removed files.
repo index --forcerebuilds from scratch. - Retrieval is BM25 over those chunks, with identifiers pre-expanded into
sub-tokens so
get usermatchesgetUserName.--lang/--pathfilter inside the query. No model server, no network, sub-millisecond queries.
Retrieval quality and behavior are measurable and reviewable out of the box:
repo eval— runs the golden queries ineval.yaml(this repo ships one) and reports recall@k, MRR, nDCG@k, and latency percentiles. Full reports persist under~/.cache/repo/evals/;repo eval --initwrites a starter spec for another repository.repo metrics— aggregates the local JSONL telemetry log (~/.cache/repo/metrics/): query counts and latency percentiles, zero-result queries, errors, index-build history, and eval trends.--tail Nshows raw events;--jsonemits the summary.repo search -vprints each query's trace (timing and candidate count).
Recording is local-only and on by default; disable with
observability.enabled: false in repo.yaml (or log_queries: false to keep
only a query hash). Logs rotate at 10 MB.
Run repo as an MCP server over stdio, exposing its features directly to AI agents:
repo mcpClient configuration (opencode, Claude Desktop, Cursor, …) — spawn one server per workspace; the server resolves the repo root from its working directory:
{
"mcpServers": {
"repo": { "command": "repo", "args": ["mcp"] }
}
}Four tools:
| Tool | Maps to | Notes |
|---|---|---|
context |
repo context |
repo overview; optional stats/analysis/audit/symbols |
search |
repo search |
ranked BM25; auto-builds the index |
refs |
repo refs |
symbol defs/impls/methods/importers/references; omit the symbol to list all |
task |
repo lint/fmt/build/test |
one tool, kind parameter; captured per-command results, isError on failure |
--full: run all commands, including heavy ones (> 5s).-v, --verbose: show detailed output (headers, live command output).
| Type | Detection files | Linters | Formatters |
|---|---|---|---|
| Node.js | package.json |
ESLint, TypeScript | Prettier, ESLint --fix |
| Python | pyproject.toml, requirements.txt |
Ruff, Pylint | Ruff format, Black |
| Rust | Cargo.toml |
Clippy | rustfmt |
| Go | go.mod |
go vet, staticcheck | gofmt |
| JVM | build.gradle*, pom.xml |
Checkstyle | Spotless |
Universal checks (when configured): Semgrep, Knip, Gitleaks, Trivy, Trufflehog, shellcheck, markdownlint, prettier, dprint.
cargo build # debug build
cargo run -- --help # run via cargo
cargo fmt # format
cargo clippy --all-targets -- -D warningsMIT