Owen718/snapgrep
一个进程内三元组索引,使Pi&DSH中的代码搜索比ripgrep快20-70倍,结果相同且无附属进程。
Project Overview项目介绍
snapgrep is an accelerated code search tool built around an in-process trigram index, that delivers 40 to 1900x speedups over ripgrep on warm indexes. It runs entirely inside the existing agent process with no sidecar daemon or extra background process, requiring just a 3.2MB native addon. It integrates with multiple coding agents including Pi, oh-my-pi, and DeepSeek Harness (DSH). For DSH users, install via the command dsh plugin --profile headless add snapgrep, which automatically replaces DSH’s built-in grep and glob tools. All search results are byte-for-byte verified against ripgrep to guarantee accuracy.
Coding agents perform frequent code searches, and ripgrep re-reads every byte from disk every search, which adds up to hundreds of milliseconds of wait time per search, multiple times per minute. snapgrep fixes this by keeping a compressed trigram index of the repository mapped in memory, so most searches never need to read file content from disk. It automatically falls back to ripgrep when the index is being rebuilt after code changes, so you will always get correct results even when you are actively editing code. It is ideal for anyone who uses AI coding agents and works with large code repositories.
snapgrep is built with Rust and exposes its functionality to Node via N-API. Prebuilt binaries are available for macOS (Apple Silicon and Intel), Linux (x64 and arm64 glibc), and Windows x64. Alpine Linux with musl libc is not currently supported. Only the correct binary for your host architecture and operating system is downloaded on install, so you do not need to compile anything locally. The project is open source under the MIT license, and the total download size is only around 1.2MB.
snapgrep 是一个基于三元组索引的代码搜索加速工具,可替代 ripgrep 为多个编码 agent 提供数十到上千倍的搜索速度提升,目前支持 Pi、oh-my-pi 和 DeepSeek Harness(DSH)。它将索引直接嵌入 agent 进程运行,不需要额外的守护进程或 Sidecar 进程,仅占用约 3.2MB 的原生扩展空间。
对于 DSH 用户,可通过 dsh plugin --profile headless add snapgrep 命令完成安装,安装后会自动替换内置的 grep 和 glob 工具,glob 工具保持原有 ripgrep 调用逻辑不变。它适合日常需要频繁在大型代码仓库进行代码搜索的开发人员和 AI 编码 agent 用户,能大幅减少搜索等待时间。
snapgrep 使用 N-API 调用 Rust 编译的原生模块,预构建支持 macOS(Intel 和 Apple Silicon)、Linux(x64 和 arm64 glibc)和 Windows x64,暂不支持 Alpine/musl。项目基于 MIT 许可证开源,仅下载对应平台的预构建包,无需本地编译即可使用。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:snapgrep(Owen718/snapgrep)
仓库:https://github.com/Owen718/snapgrep
本站详情页:https://www.yhbd.top/plugins/owen718-snapgrep/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 11 · 最近提交 2026-08-15 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- 11 stars - an early-stage project星标 11,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile headless add snapgrep
把 Owen718/snapgrep 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
snapgrep
An in-process trigram index that makes code search in Pi
Typically 40–70× faster than ripgrep on a warm index —
and every result is checked against ripgrep, byte for byte.
No sidecar process. No daemon. A single 3.2 MB native addon loaded inside the agent process.
Install
Pi
npm install -g snapgrep
Pi's built-in grep is replaced automatically, in every project. To confirm, ask Pi to search for a string you know exists — the tool detail shows actualBackend: kernel.
oh-my-pi (omp)
npm install -g snapgrep
Same package, no changes: omp treats @earendil-works/pi-coding-agent as an aliased scope and its loader accepts .pi directories alongside .omp.
DeepSeek Harness (dsh)
dsh plugin --profile headless add snapgrep
Verify with dsh --profile headless --dump-config | grep snapgrep.
It replaces both grep and glob: the registry rejects a duplicate tool name outright, so the built-in search row is disabled and this plugin supplies both. glob runs the same ripgrep invocation the built-in used.
Only the addon your machine can run is downloaded — about 1.2 MB, two packages. Nothing is compiled and no daemon is started.
Prebuilt for macOS (Apple Silicon and Intel), Linux (x64 and arm64, glibc), and Windows x64. Alpine/musl is not built yet; on an unsupported platform the extension names the exact file it could not find rather than failing silently.
Other ways to install — no npm, single project, or one copy for every machine
Without npm, a script fetches the matching archive from the latest release and installs into ~/.pi/agent/extensions:
curl -fsSL https://raw.githubusercontent.com/Owen718/snapgrep/main/install.sh | sh
Set PI_EXTENSIONS_DIR to install elsewhere. For a directory that works on any machine, snapgrep-extension-all-platforms.tar.gz from the same release carries all five addons and picks the right one at load time.
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
Js2Hou/dsh-mcp-manager
Tencent/BrowserSkill
YaoApp/yao
anbeime/skill
Jesseovo/last30days-skill-cn
bowenliang123/dsh-context
platonai/Browser4