llmgrep 3.0.7

Smart grep over Magellan code maps with schema-aligned JSON output
Documentation

llmgrep

Crates.io Documentation

Version: 3.0.7

Semantic code search for Magellan databases. Fast, deterministic symbol search with LLM-optimized JSON output.

Positioning: Read-only query tool for codebases indexed by Magellan. Use to find symbols, references, and call relationships. Emits structured JSON for AI-assisted code understanding.

Purpose

llmgrep queries Magellan databases. Built for:

  • AI Assistants — Structured JSON output designed for LLM consumption
  • Developers — Fast symbol search without IDE overhead
  • Tooling — Scriptable code analysis with precise byte spans

Features

  • Symbol search — Find functions, structs, traits by name or regex
  • Reference lookup — Find all callers/callees of a function
  • Call graph traversal — Navigate caller → callee relationships
  • AST filtering — Filter by node kind, nesting depth, complexity
  • Magellan algorithms — Condense, paths, cycles, dead-code, slicing
  • FQN autocomplete — Prefix-based symbol completion (Native-V3)
  • Exact lookup — O(1) symbol resolution by fully-qualified name (Native-V3)

Quick Start

# Install
cargo install llmgrep

# Requires Magellan database (create first)
magellan watch --root ./src --db code.v3

# Search symbols
llmgrep --db code.v3 search --query "parse"

# Find references
llmgrep --db code.v3 search --query "MyType" --mode references

# FQN autocomplete (Native-V3)
llmgrep --db code.v3 complete --prefix "my_crate::module::"

# Exact symbol lookup (Native-V3)
llmgrep --db code.v3 lookup --fqn "my_crate::module::function_name"

# Label-based search (Native-V3)
llmgrep --db code.v3 search --mode label --label test

Installation

cargo install llmgrep

Or build from source with Native-V3 backend:

# Native-V3 backend (recommended - fastest, O(1) KV operations)
cargo install llmgrep --features native-v3

Backends

Feature Description File Best For
native-v3 High-performance binary backend with KV store .v3 Production (recommended)
(default) SQLite backend via rusqlite .db Compatibility

Native-V3 exclusive features:

  • complete — FQN prefix autocomplete
  • lookup — O(1) exact symbol lookup
  • search --mode label — Purpose-based search (tests, entry points)

Both backends have full feature parity for standard search operations.

Requirements

Documentation

What llmgrep Does NOT Do

  • ❌ Index code (use Magellan)
  • ❌ Type checking or semantic analysis
  • ❌ Background file watching
  • ❌ Code editing (use splice)
  • ❌ CFG analysis (use Mirage)

License

GPL-3.0-only. See LICENSE.