ivygrep

io.github.bvolpato由 GitHub 帳號 bvolpato 發布v1.3.1更新於 Oct 29, 2026

Local code search and task context packs for coding agents

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

本機程式碼與筆記搜尋伺服器,為編碼助理提供排序後的檢索結果與依 token 預算裁剪的任務脈絡包。

可以做什麼
  • 依自然語言意圖、精確字面、符號、參照或呼叫者搜尋程式碼與筆記,支援路徑、語言與萬用字元篩選
  • 依任務描述、貼上的路徑,以及相對於某個 Git 參照的已提交、暫存與未提交變更,產生依 token 預算裁剪的脈絡包
  • 在本機為程式碼儲存庫與筆記目錄建立索引,並由常駐程序隨檔案變動持續更新
  • 回傳排序後的檔案路徑、行號、預覽,以及每筆入選證據的選取理由,部分失敗時附上警告
適用情境
適合讓編碼助理在廣泛掃描檔案系統之前先檢索本機儲存庫或筆記目錄,也適合需要依程式碼關係與近期變更拼裝實作脈絡、而非直接傾倒原始檔案的場合。
執行需求
以本機程序在使用者電腦上執行(僅桌面端),可透過 Homebrew、WinGet、發行安裝腳本或原始碼建置安裝;MCP 設定以 --mcp 參數啟動 ig 執行檔。未宣告帳號或 API 金鑰。預設神經模型首次使用時下載固定資源,hash 模式可避免模型下載。Git 為選用,但使用 --since 變更脈絡時需要。
安裝前請注意
被索引的檔案內容(包括允許索引的點檔案)可能出現在片段與結果中,不要索引含機密的目錄。本機 Web 介面會在列印的網址中帶有工作階段權杖,需保密該輸出,且不要把非回送位址的監聽埠暴露到網際網路。索引家目錄或檔案系統根目錄時會要求確認。此伺服器不會修改檔案,也不產生答案。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 ivygrep,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[ivygrep logo]

Search code and notes. Build context for coding tasks.
Files and queries stay on your machine. The default model downloads its pinned assets on first use.

[CI] [Security] [Relevance] [Latest release] [MIT license]

[ivygrep search followed by a bounded task-context pack]

Website · Architecture · Benchmarks · Contributing · Discussions

Search and build context

bash
# Find code by intentig "where is refresh token rotated?"
# Build context from code and current changesig context "fix refresh-token races" --since main --budget 8000

Abridged output:

text
# ivygrep contextBudget: 7642 / 8000 estimated tokensCoverage: 7 files | 2 primary | 1 definitions | 1 dependencies | 0 dependents | 2 callers | 0 references | 1 tests | 0 config | 0 docsCandidates: 31 retrieved | 14 selected## Evidence### 1. src/auth/refresh.rs:118-166 [primary, definition]Why: task anchor; changed implementation.Signals: lexical, symbol, git change.

Search returns ranked file paths, line numbers, and previews. Context packs add related code and explain why each item was selected.

The context command uses your task, file paths in pasted text, and staged or uncommitted changes. With --since, it resolves the selected ref and finds its Git merge base with HEAD. The pack includes changes committed on the current branch since that base, plus staged, unstaged, and untracked files. The selected ref does not act as the diff base itself. Deleted changes can contribute Git history labeled git_deleted to a context pack. The unreleased deletion fix excludes missing files from current search results. The pack can include definitions, callers, dependencies, tests, configuration, and documentation. It trims the rendered Markdown to the requested estimated token budget. It does not generate an answer or modify files.

Use --since main, --since HEAD~3, or --since '@{upstream}' inside a Git worktree. For a directory without Git, omit --since.

Install

bash
# Homebrew on macOS or Linuxbrew install bvolpato/tap/ivygrep
# Release installer on macOS or Linuxcurl -fsSL https://raw.githubusercontent.com/bvolpato/ivygrep/main/install.sh | sh
powershell
# WinGet on Windowswinget install --id BrunoVolpato.ivygrep --exact
# Release installer on Windowsirm https://raw.githubusercontent.com/bvolpato/ivygrep/main/install.ps1 | iex

Installers select a compatible archive, verify its SHA-256 checksum, and install ig. The shell installer selects a Metal build on Apple Silicon. It selects CUDA only on Linux x86_64 when an NVIDIA GPU with compute capability 8.0 or newer is visible and the CUDA 13 runtime is available. Other supported hosts use the portable build. Homebrew installs the Metal build on Apple Silicon and portable builds on Intel macOS and Linux. CUDA and Metal accelerate optional transformer profiles; the default model runs on CPU in every build. Run ig hardware to check compatibility and see the matching reinstall command.

Build from source on macOS or Linux:

bash
git clone https://github.com/bvolpato/ivygrep.git && cd ivygrep./build.shmkdir -p ~/.local/bininstall -m 0755 target/release/ig ~/.local/bin/ig

Search

The first query indexes the current repository. The daemon then watches for changes and updates the index incrementally.

Starting with v1.3.1, search immediately excludes a file that the safe file reader confirms is missing, even before watcher reconciliation. Reconciliation then removes entries owned by that workspace. Permission, unavailable, and symlink failures are not treated as deletion. Earlier releases retain the indexed-text fallback for missing files.

Linked Git worktrees share a base index. An overlay tombstone hides a base-backed file deleted on that branch without changing what other worktrees can search. Deleting a file added only in the worktree removes its overlay entries and does not need a base tombstone.

bash
ig "where is authentication handled?"       # hybrid semantic + lexicalig --literal "handleAuth"                    # exact indexed lookupig --symbol calculate_tax                    # definitionsig --refs calculate_tax                      # references and callsig --callers calculate_tax                   # caller chunksig "database migrations" src/api/           # path scopeig --all "retry policy"                      # all indexed projectsig --interactive "auth flow"                 # terminal UIig --web "auth flow" .                       # local Web UI

Useful controls include -n for result files, -C for context lines, --type for language, --include/--exclude path globs, --lexical-only, --hash, and --json. --hash uses lightweight local embeddings for faster startup and no model download, with lower semantic quality. Run ig --help for full reference.

Literal search ranks files by matching lines. A bounded search shows up to three previews per file and reports omitted matches. Use --no-limit to return every match, or --file-name-only to return paths without building previews.

Standalone uppercase AND, OR, and NOT are Boolean operators. For example, ig "settings NOT render" excludes results that contain render. Short malformed expressions, such as a trailing OR, return an error.

If an invalid Boolean query spans multiple lines or has at least 13 words, ivygrep searches it as plain text. The results include a warning. The CLI writes it to stderr. MCP and the Web UI return it in warnings. Valid Boolean expressions keep their Boolean meaning, including in long prompts. To search operator words as text, use lowercase letters or wrap the words in backticks or quotes.

Multi-line queries that read as pasted source rank the code that contains the snippet above one-line definition signatures that share a few of its identifiers. Multi-paragraph prompts, pasted issue text, and questions with a blank line rank as prose, with signature matches scored like body text. For pasted error output, such as a traceback, a Caused by: chain, or a panicked at line, lexical, path, hash-vector, and reranking signals ignore runtime values such as paths outside the workspace, ids, and timestamps, and the static message text is matched against the code that raises it. Neural query vectors still embed the original text.

On macOS laptops, background neural enhancement pauses on battery power (ig --status shows Paused: Battery Power); set IVYGREP_ENHANCE_ON_BATTERY=1 to keep it running. The lightweight hash tier keeps computing on battery so semantic results stay available. However many workspaces change at once, at most two hash and two neural enhancement workers run at a time (IVYGREP_ENHANCE_MAX_WORKERS); the rest wait in the daemon, and the workspace searched or edited last goes first.

Search notes and memories

Index notes once. Watcher keeps them current, and queries use local semantic + lexical search by default:

bash
ig --add ~/notes --wait-for-enhancementig -n 20 "what did we decide about cache invalidation?" ~/notes

Public MemoryQuest results (v1.2.7): 74.9% recall@20 at 87.63 ms warm p95. Benchmark measures retrieval only; answer accuracy is outside scope.

Connect coding agents

Codex and Claude Code packages install MCP configuration plus focused task-context skill:

bash
codex plugin marketplace add bvolpato/ivygrepcodex plugin add ivygrep@ivygrep
claude plugin marketplace add bvolpato/ivygrepclaude plugin install ivygrep@ivygrep

Automatic setup detects the client, preserves existing configuration, writes the absolute ig path, verifies the MCP handshake, and runs a search:

bash
ig agent install claudeig agent install codexig agent install cursorig agent doctor

Restart an open client after installation. Manual MCP setup is also available:

bash
claude mcp add -s user ig -- ig --mcpcodex mcp add ig -- ig --mcpgemini mcp add --scope user --transport stdio ig ig --mcp

Cursor .cursor/mcp.json:

json
{"mcpServers":{"ig":{"type": "stdio", "command": "ig", "args": ["--mcp"]}}}

OpenCode opencode.json:

json
{"mcp":{"ig":{"type": "local", "command": ["ig", "--mcp"], "enabled": true}}}

Agents call ig_search for discovery. Set output=context_pack and budget_tokens=8000 when the task needs implementation context. Pass the absolute path to the active repository or worktree. Worktrees reuse the base index and store only changed chunks and tombstones.

Context packs can include definitions, callers, references, dependencies, dependents, tests, configuration, and docs.

Setup guides: Codex, Claude Code, Cursor, Gemini CLI, OpenCode, and MCP.

Recommended agent instruction:

text
Use ivygrep before broad filesystem scans. Pass absolute active worktree path.Use natural-language queries for concepts and literal=true for identifiers.For implementation, request output=context_pack with budget_tokens=8000.

How it works

  1. A Git-aware walker finds changed or indexable files.
  2. Tree-sitter and bounded text fallbacks produce structural chunks.
  3. SQLite stores metadata and relationships. Tantivy stores lexical postings. USearch stores hash vectors and model vectors.
  4. Query routing runs bounded exact, lexical, symbol, hash, and optional neural passes before fusion.
  5. Context expands primary hits through code relationships and recent changes, then trims rendered evidence to requested token budget.

Fresh indexing publishes lexical results before vector enhancement. Worktrees reuse base index and store only divergent chunks and tombstones. Partial workspace failures return warnings with valid hits; complete failure errors.

ivygrep supports 45 language and file types. Twenty-four use Tree-sitter AST chunking: Rust, Python, Go, JavaScript, TypeScript, Java, C, C++, C#, Kotlin, Scala, PHP, Ruby, Swift, Elixir, Zig, Bash, Haskell, OCaml, Lua, Dart, Objective-C, Perl, and Starlark.

Read architecture for storage, commit order, retrieval, worktrees, protocols, security boundaries, and module ownership.

System performance

The historical v1.2.7 benchmark used a deterministic synthetic corpus with one million chunks. Across three hash-only trials, median warm CLI p95 was 6.19 ms. Controlled indexing reached 150,576 chunks/s. The final index used 0.42 GiB. These results measure scale and footprint, not retrieval quality or coding-task accuracy. They do not describe the current neural model under concurrent load.

The resource and latency report measures the released binary with both static model profiles. It includes repeated enhancement measurements, forced-neural p99, eight MCP clients, RSS, CPU, and disk writes. The model-screening report remains separate because it used one repetition.

Historical scale measurements (v1.2.7) · Million-chunk methodology · Full benchmark dashboard

The source implementation limits cached results to 64 MiB and cached neural queries to 4 MiB. Parsed context input has a shared 32 MiB cache. Content digests prevent reuse after a file changes. Idle search contexts share a 256 MiB estimated budget. Each index run has a 32 MiB estimated budget for queued payloads. A large file can exceed the indexing target when it runs alone. These budgets do not cap total process RSS. See memory budgets and diagnostics for scope and timing commands.

Local and private

Runtime source, queries, embeddings, results, and indexes stay local. Neural profiles download pinned model assets on first use unless cache is already populated. Use --hash, ./build.sh --hash-only, or cargo build --locked --no-default-features to avoid model downloads.

ig --web binds to loopback by default. Its Web API requires a session token, including on loopback. The printed URL contains that token. Keep terminal output and logs that capture it private. The browser opens through an owner-only redirect file in the app home. This keeps the token out of process arguments. To skip the browser, set IVYGREP_NO_BROWSER=1.

Non-loopback listeners use plain HTTP. Use a trusted network, Tailscale, or an encrypted tunnel. Never expose the listener directly to the internet. Indexed file contents can appear in snippets. This includes dotfiles that your ignore rules permit.

Report vulnerabilities through a private security advisory. Release archives include checksums, SBOMs, and provenance.

Data and configuration

Indexes and daemon state live in ~/.local/share/ivygrep on every OS (under %USERPROFILE% on Windows). IVYGREP_HOME overrides that path; otherwise a non-empty XDG_DATA_HOME selects $XDG_DATA_HOME/ivygrep. Model assets use the Hugging Face cache (HF_HOME, default ~/.cache/huggingface), which other tools may share.

There is no configuration file. Use CLI flags and the environment variables.

bash
ig --status          # tracked workspaces, index health, vector coverage, disk usageig --rm ~/notes      # remove a saved index; defaults to current directoryig --gc              # remove indexes whose directory has been gone past the grace period

Starting with v1.3.1, a CLI search or context request, ig --interactive, or ig --add prompts before it builds an index for your home directory, a directory containing it, or the filesystem root. Confirm with y or yes. Without an interactive terminal, the command stops unless you pass --yes. An already indexed, healthy directory does not prompt on a plain ig --add. ig --add --force rebuilds it, and --skip-gitignore may add ignored files, so those cases prompt too.

The daemon also removes the index of a directory that stays missing for seven days (IVYGREP_INDEX_GC_GRACE_SECS), and the overlay of a worktree removed with git worktree remove after ten minutes.

Troubleshooting, upgrade, and uninstall

bash
ig --doctor          # diagnose index, daemon, watcher, and model healthig --doctor --fix    # repair a broken or stale indexig --add . --force   # rebuild current workspace index from scratchig hardware          # inspect detected hardware and matching build

Open the URL ig --web prints: a bare http://127.0.0.1:4747/ returns 401 until the browser has the session cookie that URL sets. If ig --web opens a page that cannot load its redirect file, as snap-packaged browsers on Ubuntu do for files under hidden directories, open the URL it prints. Under WSL, a Windows browser can load the redirect file only through an opener that translates Linux paths, such as wslview; otherwise open the printed URL.

Upgrade through the channel you installed from: brew upgrade ivygrep, winget upgrade --id BrunoVolpato.ivygrep --exact, or rerun the installer. The next command restarts a daemon from an older build; index format changes rebuild existing indexes once on first use.

To uninstall, run brew uninstall ivygrep or winget uninstall --id BrunoVolpato.ivygrep --exact, or delete ig from the installer directory (~/.local/bin or %LOCALAPPDATA%\ivygrep\bin unless IVYGREP_INSTALL_DIR was set). Then stop any running ig --daemon process and delete the data directory.

Contribute

bash
./test.sh --quick./test.sh./bench.sh

Start with a good first issue, read CONTRIBUTING.md and architecture, or discuss an idea in Discussions.

MIT licensed. Maintained by Bruno Volpato.

來源:README.md,提交 3a379ec

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v1.3.1最新Oct 29, 2026
  2. v1.3.0Sep 26, 2026
  3. v1.2.16Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分