Repolode
yoanbernabeu

yoanbernabeu/grepai

A privacy-first CLI for semantic code search with local embeddings, call-graph tracing, and an MCP server for AI coding agents.

Stars
1,940
Forks
160
Open issues
81
Last commit
6 days ago

What is it?

grepai is a command-line tool for searching codebases by meaning rather than exact text. It builds a vector index of your code using embeddings, so a natural language query like "user authentication flow" can surface relevant functions even when they use different names.

The tool runs entirely on your machine and works with a local embedding provider such as Ollama, with LM Studio or OpenAI also supported. A background file watcher keeps the index updated as files change. It also includes call graph tracing, so you can see who calls a function before modifying it.

grepai exposes itself as an MCP server, letting AI agents such as Claude Code, Cursor, and Windsurf call it as a tool. The project states that this reduces the input tokens agents spend reading code, since they receive targeted context instead of raw search output.

Key features

  • 01Semantic search that matches code by intent, not exact text
  • 02Call graph tracing to find callers of a function
  • 03Fully local operation with Ollama, LM Studio, or OpenAI embeddings
  • 04File watcher that keeps the index up to date automatically
  • 05MCP server for calling grepai from AI agents

Use cases

  • Letting Claude Code or Cursor find relevant code without reading whole files
  • Locating code by concept when you do not know the exact function name
  • Checking callers of a function before refactoring it
  • Searching a private codebase without sending code to external services

Quick start

  1. 1

    Install via Homebrew (macOS)

    brew install yoanbernabeu/tap/grepai
  2. 2

    Install an embedding provider: pull the Ollama model nomic-embed-text

    ollama pull nomic-embed-text
  3. 3

    Initialize grepai in your project, then start the indexing daemon

    grepai init && grepai watch
  4. 4

    Search your code by meaning

    grepai search "error handling"

Things to know

  • Requires a separate embedding provider such as Ollama, LM Studio, or OpenAI.
  • Linux and Windows installs use a curl or PowerShell install script rather than a package manager in the README.

In collections

Topics

FAQ

What is grepai?
A privacy-first CLI for semantic code search with local embeddings, call-graph tracing, and an MCP server for AI coding agents. grepai is a command-line tool for searching codebases by meaning rather than exact text. It builds a vector index of your code using embeddings, so a natural language query like "user authentication flow" can surface relevant functions even when they use different names.
Is grepai free to use? What license does it have?
grepai is open source under the MIT license. Check the license terms before using it in commercial products.
Is grepai still maintained?
Actively maintained. The last commit to grepai was on Nov 2, 2026.
What can I use grepai for?
Letting Claude Code or Cursor find relevant code without reading whole files Locating code by concept when you do not know the exact function name Checking callers of a function before refactoring it Searching a private codebase without sending code to external services
How do I install grepai?
Install via Homebrew (macOS): brew install yoanbernabeu/tap/grepai Install an embedding provider: pull the Ollama model nomic-embed-text: ollama pull nomic-embed-text Initialize grepai in your project, then start the indexing daemon: grepai init && grepai watch Search your code by meaning: grepai search "error handling"
Where can I get grepai?
The source code and installation instructions are on GitHub: https://github.com/yoanbernabeu/grepai

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects