Gabb CLI
Gabb is a Rust CLI that builds a local code index so editors and AI coding assistants can answer questions like "where is this implemented?" without shipping your sources to a remote service. It includes an indexing daemon that stays in sync with filesystem changes.
Status
- Indexes TypeScript/TSX, Rust, and Kotlin, storing results in a local SQLite database
- Commands:
gabb daemon(watches a workspace and keeps the index fresh),gabb symbols(list indexed symbols),gabb symbol(show details for a symbol),gabb implementation(find implementations for a symbol),gabb usages(find call sites/usages for a symbol) - Outputs: symbol definitions, relationships (implements/extends), and references
Quickstart
# 1) Build (or install) the CLI
# 2) Start the daemon from your project root
# 3) Let the daemon watch for changes; the index lives at .gabb/index.db
The daemon will crawl your workspace, index all supported files, and keep the SQLite database up to date as files change. Use -v/-vv to increase logging.
Installation
- Prerequisite: Rust toolchain (Edition 2024). Install via rustup.
- Install locally from source:
- Or build without installing:
Usage
Flags:
--root: workspace to index (defaults to current directory)--db: SQLite database path (defaults to.gabb/index.db)--rebuild: delete any existing DB at--dband perform a full reindex before watching-v,-vv: increase log verbosity Symbols command filters:--file: only show symbols from a given file path--kind: filter by kind (function,class,interface,method,struct,enum,trait)--limit: cap the number of rows returned Implementation command:- Identify the symbol via
--fileand--line/--characteror embed the position as--file path:line:char - Finds implementations via recorded edges (implements/extends/trait impl/overrides); falls back to same-name matches
Usages command:
- Identify the symbol under the cursor (same options as above)
- Lists recorded references from the index; if none are present (e.g., cross-file Rust calls not yet linked), falls back to a best-effort name scan across all indexed files in the workspace root
- Skips matches that overlap the symbol’s own definition span
Symbol command:
- Look up symbols by exact name (optional file/kind filters)
- Shows definition location (line/col), qualifier, visibility, container, incoming/outgoing edges, and recorded references for each match
What gets indexed:
- Files:
*.ts,*.tsx,*.rs,*.kt,*.kts - Data stored: symbols (functions, classes, interfaces, methods, etc.), relationships (implements/extends), references
- Storage: SQLite with WAL enabled for safe concurrent reads
Project Layout
src/main.rs: CLI entrypoint and logging setupsrc/daemon.rs: filesystem watcher and incremental indexing loopsrc/indexer.rs: full/index-one routines and workspace traversalsrc/languages/: language parsers (TypeScript, Rust, Kotlin) built on tree-sittersrc/store.rs: SQLite-backed index storeARCHITECTURE.md: deeper design notes
Development
- Format and lint:
cargo fmt && cargo clippy --all-targets --all-features - Tests:
cargo test - Docs:
cargo doc --open
Roadmap
- Additional commands (find implementations/usages) backed by the stored relationships
- More languages by swapping in new tree-sitter grammars
- Richer queries (duplicates, unused code) atop the same index
Contributing
Issues and PRs are welcome. Please:
- Keep commits focused and prefer Conventional Commits (
feat: ...,fix: ...) - Add or update tests when changing indexing behavior
- Run
cargo fmt,cargo clippy, andcargo testbefore submitting