gabb-cli 0.7.1

Fast local code indexing CLI for TypeScript, Rust, and Kotlin projects
Documentation

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 start/stop/restart/status, gabb symbols, gabb symbol, gabb implementation, gabb usages, gabb definition, gabb duplicates, gabb mcp-server
  • Outputs: symbol definitions, relationships (implements/extends), and references
  • MCP server for AI assistant integration (Claude Desktop, Claude Code)

Quickstart

# 1) Build (or install) the CLI
cargo build        # or: cargo install --path .

# 2) Start the daemon in background from your project root
gabb daemon start --background

# 3) Query the index
gabb symbols --kind function --limit 10
gabb symbol --name MyClass
gabb usages --file src/main.rs:10:5

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.

Query commands (symbols, usages, etc.) will auto-start the daemon if it's not running.

Installation

  • Prerequisite: Rust toolchain (Edition 2024). Install via rustup.
  • Install locally from source:
    cargo install --path .
    
  • Or build without installing:
    cargo build
    

Usage

gabb daemon start --root <workspace> --db <path/to/index.db> [--rebuild] [--background] [-v|-vv]
gabb daemon stop [--root <workspace>] [--force]
gabb daemon status [--root <workspace>]
gabb symbols --db <path/to/index.db> [--file <path>] [--kind <kind>] [--limit <n>]
gabb symbol --db <path/to/index.db> --name <name> [--file <path>] [--kind <kind>] [--limit <n>]
gabb implementation --db <path/to/index.db> --file <path[:line:char]> [--line <line>] [--character <char>] [--limit <n>] [--kind <kind>]
gabb usages --db <path/to/index.db> --file <path[:line:char]> [--line <line>] [--character <char>] [--limit <n>]
gabb mcp-server --root <workspace> --db <path/to/index.db>

Flags:

  • --root: workspace to index (defaults to current directory)
  • --db: SQLite database path (defaults to .gabb/index.db)
  • --rebuild: delete any existing DB at --db and 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 --file and --line/--character or 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

MCP Server (AI Assistant Integration)

Gabb includes an MCP (Model Context Protocol) server that exposes code indexing tools to AI assistants like Claude. This allows Claude to search symbols, find definitions, usages, and implementations in your codebase.

Available Tools

Tool Description
gabb_symbols List or search symbols in the codebase
gabb_symbol Get detailed information about a symbol by name
gabb_definition Go to definition for a symbol at a source position
gabb_usages Find all usages/references of a symbol
gabb_implementations Find implementations of an interface, trait, or abstract class
gabb_daemon_status Check the status of the gabb indexing daemon

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "gabb": {
      "command": "gabb",
      "args": ["mcp-server", "--root", "/path/to/your/project"]
    }
  }
}

Replace /path/to/your/project with your workspace path. The MCP server will auto-start the daemon if needed.

Claude Code Configuration

Add the following to your Claude Code MCP settings:

{
  "mcpServers": {
    "gabb": {
      "command": "gabb",
      "args": ["mcp-server", "--root", "."]
    }
  }
}

Using --root . means gabb will use the current working directory as the workspace root.

Project Layout

  • src/main.rs: CLI entrypoint and logging setup
  • src/daemon.rs: filesystem watcher and incremental indexing loop
  • src/indexer.rs: full/index-one routines and workspace traversal
  • src/languages/: language parsers (TypeScript, Rust, Kotlin) built on tree-sitter
  • src/store.rs: SQLite-backed index store
  • src/mcp.rs: MCP server implementation for AI assistant integration
  • ARCHITECTURE.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, and cargo test before submitting