需先准备嵌入提供方,默认走 Ollama 并手动拉取 nomic-embed-text 模型;搜索前要先跑 grepai watch 建好索引;项目采用 issue first,不接受直接提交 PR。
brew install yoanbernabeu/tap/grepai
ollama pull nomic-embed-text
grepai init && grepai watchREADME 未说明具体硬件要求;代码与索引 100% 本地运行,需本地或远程提供嵌入服务(Ollama、LM Studio 或 OpenAI)。
本地语义代码搜索 CLI,用向量嵌入按意图找代码并追踪调用关系
本地运行的代码语义搜索与调用图工具,让 AI 编程助手在不上传代码的前提下理解仓库结构、定位相关代码。
核心能力
- 用向量嵌入按语义意图检索代码,不依赖命名约定
- 追踪函数调用图,改动前查清谁在调用
- 内置文件监听守护进程,索引自动保持最新
- 提供 MCP 服务,AI 代理可直接把 grepai 当工具调用
- 兼容 Claude Code、Cursor、Windsurf 等 AI 代理
容易踩的坑
- v1.2.0最新正式版2026-10-30 · 2026-10-30 09:51 UTC
grepai 1.2.0
Semantic code search CLI tool.
Changelog
Bug Fixes
- 0debb8fc2901a0a998df2b43d76c41445d8ec77e: fix(daemon): hold watch PID locks while the daemon runs (#407) (@yoanbernabeu)
- 6f3ecf1d9237f7ed0c09993556649ea46be59caf: fix(embedder): only send environment API keys to official endpoints (#411) (@yoanbernabeu)
- 39a6c2b1b389afcdcbf4c909f684f099d2e1b439: fix(framework): refuse a node_path that points into the project (#412) (@yoanbernabeu)
- 51391d4cea452c6abe52ceb001bf91d659481cc8: fix(indexer): keep previous chunks until batch embeddings succeed (#405) (@yoanbernabeu)
- 9b8ff91f0ef999f927bca2773b1853e79761c2aa: fix(indexer): stop reusing vectors embedded under another file path (#410) (@yoanbernabeu)
- da4ab8b2d6e821171ec4ae4557bf956501155534: fix(qdrant): keep projects sharing an explicit collection apart (#408) (@yoanbernabeu)
- e466efd4c206a877a0c184fe34b572e1d0c95c66: fix(store): clear document chunk IDs when deleting a file's chunks (#406) (@yoanbernabeu)
- 778bf5623cf761b9ac1b90be28816221217a06b3: fix(store): set chunk IDs in Qdrant search results and wait for writes (#414) (@yoanbernabeu)
- 8045e957a42435878764a82c86ffd32af3f743fb: fix(trace): report real callees and pick same-name definitions deterministically (#413) (@yoanbernabeu)
- 661d05838472c23e2bb9ff85cec7e63d539f75a9: fix(workspace): find a project's chunks from relative paths (#409) (@yoanbernabeu)
Other Changes
- bd0b7320a599e22d9539dae3213ee5cb980c0bb4: chore(claude): add triage skill for the V1 feature freeze (#404) (@yoanbernabeu)
- d86397d5f0c94ea31b96d1bb8b4da6966e26f5ef: chore(release): bump version to 1.2.0 (#416) (@yoanbernabeu)
- 78a9b519ea3f52b7ac4bad4d7abd42daebda4490: docs(security): warn about indexing untrusted repositories (#415) (@yoanbernabeu)
Full Changelog: https://github.com/yoanbernabeu/grepai/compare/v1.1.0...v1.2.0
- v1.1.02026-10-26 · 2026-10-26 16:06 UTC
查看更新说明
grepai 1.1.0
Semantic code search CLI tool.
Changelog
New Features
- e14bf7b9eb94f8f1cde3cfc5a3e03f41582149bc: feat(embedder): make embedding batch limits configurable (#399) (@yoanbernabeu)
- 738b70ea7ea122cff599d3572c395dc2abaf0d94: feat(store): warn when a gob index is too large and point to qdrant (#402) (@yoanbernabeu)
Bug Fixes
- cf41c3ea771319bdb43de6b0463ed5c0733f4d51: fix(cli): remove unused SearchJSON helper (#395) (@yoanbernabeu)
- 216150fd2b027dbd0b7aea28fb3d668ae71939e3: fix(mcp): enrich trace results from the root override's RPG graph (#396) (@yoanbernabeu)
- 8cb65d4194e028c2dcd4cedc8833aa7426cff595: fix(store): match Postgres path prefix literally (#394) (@yoanbernabeu)
- 877a8c0c9fd80c5e1f8121adc2bdde8cbf876eac: fix(watcher): apply the scanner's ignore rules to dotfiles (#400) (@yoanbernabeu)
- f6e84c74f14c499df2747041acab648ce2ea7ec1: fix(watcher): follow the scanner's custom extensions (#401) (@yoanbernabeu)
- a3edd7cbe1be327e1cd24c1a367ff1d1ba5ef742: fix(workspace): keep re-chunked chunk IDs unique in prefixed stores (#398) (@yoanbernabeu)
Other Changes
- dd38459f31a8b25e49b886511a15667caf43478b: chore(release): bump version to 1.1.0 (#403) (@yoanbernabeu)
- 9d7b05d2acc4a202335f796eefcc028a78cbe576: deps: bump github.com/mark3labs/mcp-go from 1.0.0 to 1.3.0 (#390) (@dependabot[bot])
- de3cb0336f2d3b84347701eb6feab23db6a5e8dd: deps: bump github.com/qdrant/go-client from 1.19.2 to 1.20.0 (#391) (@dependabot[bot])
- 08e61dfcbc8d9399aa078940f1f2583da96f5e01: docs(agents): migrate CLAUDE.md to AGENTS.md and add V1 stability rules (#393) (@yoanbernabeu)
- 93cb05b7601fd2ac76ef47227925ea1f1ceac121: docs(blog): announce grepai 1.0 (@yoanbernabeu)
- 70289cd9563899cd0f52a1c29eca6e65c2adf7e2: docs(contributing): switch to an issue-first contribution flow (@yoanbernabeu)
Full Changelog: https://github.com/yoanbernabeu/grepai/compare/v1.0.0...v1.1.0
- v1.0.02026-10-25 · 2026-10-25 15:34 UTC
查看更新说明
grepai 1.0.0
Semantic code search CLI tool.
Changelog
New Features
- d7cf3786832819470dae4610abac0fff72fcfe24: feat(docs): new art direction, landing page, docs rewrite and SEO (#343) (@yoanbernabeu)
- 9e9c0751fa303fa9c61fcdd17c10f559b270f8b5: feat(trace): add GDScript (.gd) support ( <>)
- 00b0a2fd6fda9bbb40a0851e82d2f84c33c2e0ab: feat(trace): add Ruby support (@yoanbernabeu)
Bug Fixes
- 4d57fd66467a4b217a82edf38c55df2b6a777cdd: fix(index): rebuild the index when the embedding model changes (@yoanbernabeu)
- c1c8297c8aa3a90180e54b6b3451b67563e19096: fix(indexer): drop orphan-map ToSlash; keep scanner slash normalization (@wwylon)
- 0dd4fe182fd6fc93c4a21f0b429d773477c5b694: fix(indexer): normalize Windows paths to forward slash so workspace watch does not orphan-delete the index (@wwylon)
- f128eafb4e5300cce7dd368a78188a6fa3fa50eb: fix(indexer): reuse embeddings of unchanged chunks when re-indexing a file (@yoanbernabeu)
- 0a458eb0e1bd1775cc3e0863e33f804d0a43507f: fix(init): keep .grepai out of git when the project has no .gitignore (@yoanbernabeu)
- ae0e916c6d580a261483473577f7f02840730713: fix(mcp): let the RPG tools read a workspace project (@yoanbernabeu)
- 335f12d8e87b5158f430e11866fcd06060bb7ba4: fix(mcp): workspace search with a path returned no results (@yoanbernabeu)
- 8d739d0af5cef0f40e89ff67729a6f2666c233d1: fix(qdrant): explain how to fix an unreachable Qdrant (@yoanbernabeu)
- 818e189f94e209c367c2b57111f83c86d0eeef4f: fix(qdrant): path-filtered search returned too few results (@yoanbernabeu)
- a268c5a53f465a7fb4592034c7bf58c60f3550a2: fix(qdrant): read every page when listing files and chunks (@yoanbernabeu)
- eb7aa48b54f460dbb787d083ee03a9679b18d222: fix(trace): extract GDScript funcs with same-line annotations ( <>)
- 32094ef3cd96d0c56714062e052dad419dca1c25: fix(trace): mask GDScript # comments like Python (@yoanbernabeu)
- 1793e3bf8fc0010d415c7106fd7375a905c1fe15: fix(trace): stop Python comments and strings from hiding call edges (@yoanbernabeu)
- 7b79fc32ce96870a798e663a852ef232c3101328: fix(watch): handle folders moved or deleted while watching (@yoanbernabeu)
- 5432fe8cb2e65b1f85fce9ba60e51676cd908ab3: fix(watch): keep the background watcher alive during a long initial index (@yoanbernabeu)
- 66a7cfb8313f5732c2ef4a2bf899b28a3c6b7518: fix(watch): never let last_index_time get ahead of the saved index (@yoanbernabeu)
- a29e048122b741c21491c5e988c0265ba691d5dd: fix(watcher): preserve config edits when updating index time (@Don-Yin)
- b899385f69daa73c246cd222206611c8f8ce2481: fix(watcher): use slash-separated paths for file events (@yoanbernabeu)
- ac4f714253dd42171d38b4711dc5ce3393e987e7: fix(workspace): reject an invalid project config instead of using defaults (@yoanbernabeu)
- 180ace1d4dd5c1bba2f369495000fb63308822ce: fix(workspace): skip missing project folders instead of refusing to watch (@yoanbernabeu)
- aa172cb92ab3115055ebe16ea2865949f3f4154e: fix: CLI bugs found during the docs audit (#345) (@yoanbernabeu)
Other Changes
- e640d3b62408d36b76a65874a399def6316cf004: chore(release): bump version to 1.0.0 (@yoanbernabeu)
- 9b3efdb4b3775e5fa8d59a6565f888f6bf43b43a: docs(changelog): add the second batch of v1 fixes (@yoanbernabeu)
- c8a7ae87fef1816ab1dec5eeb6d9c09815e33492: fix(agent-setup): tell agents to prefer the MCP tools when available (@yoanbernabeu)
Full Changelog: https://github.com/yoanbernabeu/grepai/compare/v0.39.0...v1.0.0
- v0.39.02026-10-25 · 2026-10-25 10:12 UTC
查看更新说明
grepai 0.39.0
Semantic code search CLI tool.
Changelog
New Features
- c187cbc50f001b12c52b445a7bec4db786cc5983: feat(cli): add one-time manual indexing (#299) (@harumiWeb)
Bug Fixes
- 70907bb28ed4d007a16ff10a70540561e14b4d63: fix(qdrant): stop re-indexing unchanged files by storing the file hash on every point (#324) (@greenham13)
Other Changes
- b422476f1d95f7b5cc9bb0a63f3ca68b6609eae5: chore(release): bump version to 0.39.0 (@yoanbernabeu)
- 45936ddf990dfa85390420a5102e09f1ac25204d: perf(watch): speed up restart via last_index_time persistence and shared scan decisions (#328) (@TangoMan75)
- ac9d75f641bb098c3ba359ec67a381127945bc71: test(indexer): restart IndexAll keeps unchanged documents (#334) (@wwylon)
Full Changelog: https://github.com/yoanbernabeu/grepai/compare/v0.38.0...v0.39.0
- v0.38.02026-10-24 · 2026-10-24 13:07 UTC
查看更新说明
grepai 0.38.0
Semantic code search CLI tool.
Changelog
New Features
- f8f036b69591585559e2c8039df6b9ff272d28c0: feat(indexer): add AST-aware chunking via cAST algorithm (#332) (@Don-Yin)
Bug Fixes
- eb941fe8072b7a9af87e2604896456ae16a5127d: fix(build): repair make nix-hash (@yoanbernabeu)
- 178de0a4752469f7c4cee97798e33fd19bbcde5e: fix(chunker): stop emitting a redundant chunk at the end of every file (#333) (@MaxFreedomPollard)
- 9c757b789c4164c64f9e4d1910c9f806fae38a0f: fix(watcher): apply backpressure when the file event queue is full (#326) (@greenham13)
Other Changes
- 4ddf7e60dbc0f2a01a1c034f08f8f8b5b2a575fd: chore(release): bump version to 0.38.0 (@yoanbernabeu)
- b24a044fc491fb71e3d22296cbf5bb0ba1a3983d: deps: bump github.com/jackc/pgx/v5 from 5.10.0 to 5.11.0 (#318) (@dependabot[bot])
- 3de856e14639936bcf01c6fac107a76ed7bbc11c: deps: bump github.com/qdrant/go-client from 1.19.0 to 1.19.2 (#317) (@dependabot[bot])
- d6c83e9cf32ab5e6460299389d9f43701511b9ea: deps: bump google.golang.org/grpc from 1.83.2 to 1.84.0 (#323) (@dependabot[bot])
- 0fecdd417585d11266b8b773cdb223c5ddcc4bfd: perf(embedder): batch Ollama indexing requests (#315) (@jeremyakers)
Full Changelog: https://github.com/yoanbernabeu/grepai/compare/v0.37.0...v0.38.0
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
grepai
grep for the AI era
Search code by meaning, not just text.
Documentation · Installation · Quick Start
grepai is a privacy-first CLI for semantic code search. It uses vector embeddings to understand code meaning, enabling natural language queries that find relevant code—even when naming conventions vary.
Drastically reduces AI agent input tokens by providing relevant context instead of raw search results.
Features
- Search by intent — Ask "authentication logic" and find
handleUserSession - Trace call graphs — Know who calls a function before you change it
- 100% local — Your code never leaves your machine
- Always up-to-date — File watcher keeps the index fresh automatically
- AI agent ready — Works with Claude Code, Cursor, Windsurf out of the box
- MCP server — Your AI agent can call grepai directly as a tool
Installation
Homebrew (macOS):
brew install yoanbernabeu/tap/grepai
Linux/macOS:
curl -sSL https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.sh | sh
Windows (PowerShell):
irm https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.ps1 | iex
Requires an embedding provider — Ollama (default), LM Studio, or OpenAI.
Ollama (recommended):
ollama pull nomic-embed-text
Quick Start
grepai init # Initialize in your project
grepai watch # Start indexing daemon
grepai search "error handling" # Search semantically
grepai trace callers "Login" # Find who calls a function
Shell Completion
grepai supports autocompletion for commands, flags, and dynamic values (workspace names, project names, providers, backends).
Zsh (add to ~/.zshrc):
eval "$(grepai completion zsh)"
Oh-My-Zsh plugin:
mkdir -p ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/grepai
grepai completion zsh > ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/grepai/_grepai
# Then add "grepai" to plugins=(...) in ~/.zshrc
Bash:
# Linux
grepai completion bash > /etc/bash_completion.d/grepai
# macOS (requires bash-completion@2)
grepai completion bash > $(brew --prefix)/etc/bash_completion.d/grepai
Fish:
grepai completion fish > ~/.config/fish/completions/grepai.fish
PowerShell:
grepai completion powershell | Out-String | Invoke-Expression
What developers say
"I just hit my limit and it took 13% of my max5 plan just to read my codebase. I am very, very excited about your new tool." — u/911pleasehold on r/ClaudeAI (280K+ views)
"It works great! Takes 5 minutes to install. Crazy!" — @LesSaleGeek on X
"The results are incredible!" — Kenny Nguyen on LinkedIn
Why grepai?
grep was built in 1973 for exact text matching. Modern codebases need semantic understanding.
grep / ripgrep | grepai | |
|---|---|---|
| Search | Exact text / regex | Semantic understanding |
| Query | "func.*Login" | "user authentication flow" |
| Finds | Pattern matches | Conceptually related code |
Documentation
Full docs, guides, and blog:
- Documentation — Configuration, AI agents, MCP setup
- Blog — Benchmarks, tutorials, release notes
Contributing
grepai works issue first: contributions start as an issue, and pull requests are not accepted. See CONTRIBUTING.md for how to report a bug, request a feature or test a fix.
License
MIT License - Yoan Bernabeu 2026