grepai
Privacy-first CLI for semantic code search and call graph tracing that gives AI coding agents relevant codebase context.
At a Glance
About grepai
grepai is an open-source, MIT-licensed command-line tool by Yoan Bernabeu that indexes code using vector embeddings so developers and AI coding agents can search by meaning instead of exact text. It also traces function callers and callees and exposes an MCP server. The project states that it can run fully locally with Ollama.
What It Is
grepai is a semantic code search CLI. Instead of matching literal strings like grep, it uses embeddings to find conceptually related code, so a query such as "user authentication flow" can surface relevant functions even when naming conventions differ. Results include file paths, line ranges, and relevance scores. The README states it reduces AI agent input tokens by supplying relevant context rather than raw search results.
How the Workflow Runs
A user installs the binary, runs grepai init in a project, starts grepai watch to build and keep the index current via a file watcher, then runs grepai search with natural language. grepai trace callers and trace callees show call relationships, and the docs also list reference commands, a Repository Planning Graph, hybrid search, search boost, git worktree support, and workspace management.
Embedding Backends and Privacy
An embedding provider is required: Ollama (default), LM Studio, or OpenAI. With a local provider such as Ollama, the project says code never leaves the machine. Configuration lives in .grepai/config.yaml, where the embedder provider and model are set.
Agent Integration
grepai provides a native MCP server and JSON output, plus an agent-setup command. The docs describe integration with Claude Code (including a subagent), Cursor, Codex CLI, Windsurf and Gemini CLI, and list 27 agent skills. Call graph tracing is documented for languages including Go, TypeScript, JavaScript, Python, PHP, Java, C, C#, F#, C++, Rust and Zig.
Community Discussions
Be the first to start a conversation about grepai
Share your experience with grepai, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Free, MIT-licensed self-hosted CLI for semantic code search; runs 100% locally.
- MIT License
- 100% local and private with Ollama
- Semantic code search
- Call graph tracing
- Native MCP server
Capabilities
Key Features
- Semantic code search with natural language queries
- Call graph tracing (callers, callees, graph)
- Reference analysis (readers, writers)
- Repository Planning Graph
- Real-time file watching and index updates
- Native MCP server
- JSON output for AI agents
- Hybrid search and search boost
- Git worktree support
- Workspace management
- Local or cloud embedding providers
- Shell completion
