Getting Started

From zero to sub-millisecond search in under 5 minutes. No configuration files. No daemon to set up. Every ig command is a one-shot process — install the binary, run a search, and the index builds itself.

New in v2.0.0:

  • Full feature parity with rtk — 33 native command-output wrappers (test runners, linters, build tools, git platforms, cloud CLIs). See ig vs RTK.
  • Process-per-invocation — the v1.x global daemon, Unix socket, and filesystem watcher are gone. The on-disk index is mmap'd on every search and rebuilt inline when stale.
  • Coming from RTK? Run ig import-rtk to translate your RTK filter files in one shot.

Prerequisites

  • Rust toolchain (stable) — rustup toolchain install stable
  • Cargo (comes with Rust)
  • A terminal and a project to search through

Installation

The fastest way to install ig is via the one-line installer. It downloads the latest release binary and auto-configures your AI agents.

# Install latest release + auto-configure AI agents
curl -fsSL https://raw.githubusercontent.com/MakFly/instant-grep/main/install.sh | bash

Or via Homebrew:

brew install MakFly/tap/ig

Or build from source:

# Clone and build
git clone https://github.com/MakFly/instant-grep
cd instant-grep
cargo build --release

# Copy to PATH
cp target/release/ig ~/.local/bin/ig

# Verify
ig --version

Tip: Make sure ~/.local/bin is in your $PATH. Add export PATH="$HOME/.local/bin:$PATH" to your shell config if needed.

Configure AI agents

If you used the one-line installer, agents are already configured. Otherwise run ig setup (alias ig init):

# Auto-configure every detected AI agent
ig setup

# ig setup does the following:
#  - Installs the PreToolUse hook script in ~/.claude/hooks/
#  - Registers the hook in ~/.claude/settings.json (0/1/2/3 exit-code protocol)
#  - Adds Bash(ig *) permission for Claude Code
#  - Writes a managed Search Tools block into ~/.claude/CLAUDE.md / AGENTS.md
#
# ig setup supports 11 agents: claude, codex, cursor, copilot, gemini,
# opencode, windsurf, cline, hermes, kilocode, antigravity.

Migrating from RTK? Run ig import-rtk to translate your existing RTK filters.toml (user + project) into ig's filter format in one shot — or pass ig setup --import-rtk to do it during agent setup. See the migration guide.

The index builds itself

There is no manual index step. The first ig search on a project builds the sparse n-gram index inline before returning results, and stores it in the XDG cache (~/.cache/ig/projects/<hash>/, or ~/Library/Caches/ig/ on macOS) — never inside your repo. If you want to force a build, ig index still works:

$ ig index .

* Scanning directory tree
* Skipping 38 excluded directories (node_modules, target, .git, ...)
* Building sparse n-gram index: 1,552 files (SPIMI, 2 segments)
+ Index built in 450ms
   lexicon:  31 MB   (~/.cache/ig/projects/<hash>/lexicon.bin)
   postings: 7.1 MB  (~/.cache/ig/projects/<hash>/postings.bin)
   metadata: 111 KB  (~/.cache/ig/projects/<hash>/metadata.bin)
lexicon.bin
Hash table mapping n-grams to posting list offsets
postings.bin
VByte delta-encoded file ID lists per n-gram
metadata.bin
File paths, modification times, version info

Your first search

Run ig with any regex pattern. If no index exists, it builds one automatically.

Shortcut: ig "pattern" is equivalent to ig search "pattern". The search subcommand is optional.

# Basic search
ig "async fn" src/

# Case-insensitive search
ig -i "TODO" .

# With context lines
ig -C 3 "Result<T>" .

# JSON output for AI agents
ig --json "impl Trait" .

# Filter by file type
ig --type rs "pub fn" .

How auto-build works

Every ig command is a one-shot process. When you run a search it resolves the project root, finds the matching index in the XDG cache, and mmap's it. If the index is missing — or older than any source file, or built against an out-of-date INDEX_VERSION — it rebuilds inline before answering. You never call ig index manually.

  1. ig "pattern" . called
  2. Resolve project root, locate ~/.cache/ig/projects/<hash>/
  3. If the index is missing or stale, build/refresh it inline
  4. mmap the index, extract n-grams from the regex, intersect posting lists, verify matches
  5. Results printed, process exits

Next steps