Semantic code search powered by ColBERT multi-vector embeddings and the PLAID algorithm.
Installation
Pre-built Binaries (Recommended)
macOS / Linux:
|
Windows (PowerShell):
powershell -c "irm https://github.com/lightonai/lategrep/releases/latest/download/colgrep-installer.ps1 | iex"
Specific Version:
# Replace 0.4.0 with desired version
|
Using Cargo (crates.io)
Build from Source
Build Features
| Feature | Platform | Description |
|---|---|---|
accelerate |
macOS | Apple Accelerate for vector operations |
openblas |
Linux | OpenBLAS for vector operations |
cuda |
Linux/Windows | NVIDIA CUDA for model inference |
tensorrt |
Linux | NVIDIA TensorRT for model inference |
directml |
Windows | DirectML for model inference |
Examples:
# macOS with Apple Accelerate (recommended for M1/M2/M3)
# Linux with OpenBLAS
# Linux with CUDA GPU support
# Combine features
ONNX Runtime (Automatic)
ONNX Runtime is automatically downloaded on first use. No manual installation required.
The CLI searches for ONNX Runtime in:
ORT_DYLIB_PATHenvironment variable- Python environments (pip/conda/venv)
- System paths
If not found, it downloads to ~/.cache/onnxruntime/.
Quick Start
# Search with natural language (auto-indexes on first run)
# Search in specific directory
# Limit results
Search Patterns
Basic Search
File Type Filtering (--include)
Filter by file extension or path pattern:
# Single extension
# Multiple extensions
# Path patterns
Pattern Syntax:
| Pattern | Matches |
|---|---|
*.py |
All Python files |
*.{ts,tsx} |
TypeScript and TSX files |
src/**/*.rs |
Rust files under src/ |
**/tests/** |
Files in any tests/ directory |
*_test.go |
Go test files |
*.spec.ts |
TypeScript spec files |
Hybrid Search (-e pattern + semantic)
First filter with grep, then rank semantically:
# Find files with "TODO", rank by semantic relevance to "error handling"
# Find async functions, rank by "promise handling"
# Extended regex (-E)
# Fixed string (-F) - no regex interpretation
# Whole word (-w)
Output Modes
# List files only (like grep -l)
# Show full function content
# JSON output
|
# Control context lines (default: 6)
Exclusions
# Exclude patterns
# Exclude directories
Code-Only Mode
Skip documentation and config files:
Excludes: Markdown, text, YAML, TOML, JSON, Dockerfile, Makefile, shell scripts.
Index Management
# Check index status
# Clear current project index
# Clear all indexes
# Show statistics
Index Locations
| Platform | Location |
|---|---|
| Linux | ~/.local/share/colgrep/indices/ |
| macOS | ~/Library/Application Support/colgrep/indices/ |
| Windows | %APPDATA%\colgrep\indices\ |
Configuration
# Show current config
# Set default results count
# Set default context lines
# Use INT8 quantized model (default, faster)
# Use FP32 full precision (more accurate)
# Reset to defaults (INT8, pool-factor 2)
Change Model
# Temporary (single query)
# Permanent
Config stored in ~/.config/colgrep/config.json.
IDE Integrations
# Claude Code
# OpenCode
# Codex
Supported Languages
Code (18 languages): Python, TypeScript, JavaScript, Go, Rust, Java, C, C++, C#, Ruby, Kotlin, Swift, Scala, PHP, Lua, Elixir, Haskell, OCaml
Config: YAML, TOML, JSON, Dockerfile, Makefile
Text: Markdown, Plain text, AsciiDoc, Org
Shell: Bash, Zsh, PowerShell
How It Works
- Parse: Tree-sitter extracts functions, methods, classes
- Analyze: 5-layer analysis (AST, call graph, control flow, data flow, dependencies)
- Embed: ColBERT encodes each unit as multiple vectors
- Index: PLAID algorithm compresses and indexes vectors
- Search: Query encoded and matched using late interaction scoring
Environment Variables
| Variable | Description |
|---|---|
ORT_DYLIB_PATH |
Path to ONNX Runtime library |
XDG_DATA_HOME |
Override data directory |
XDG_CONFIG_HOME |
Override config directory |
License
Apache-2.0