$git clone https://github.com/yoanbernabeu/grepaiSearch code by meaning, not just text.
| 1 | <div align="center"> |
| 2 | |
| 3 | # grepai |
| 4 | |
| 5 | ### grep for the AI era |
| 6 | |
| 7 | [](https://www.producthunt.com/products/grepai) |
| 8 | |
| 9 | [](https://github.com/yoanbernabeu/grepai/stargazers) |
| 10 | [](https://github.com/yoanbernabeu/grepai/releases) |
| 11 | [](https://github.com/yoanbernabeu/grepai/actions/workflows/ci.yml) |
| 12 | [](https://goreportcard.com/report/github.com/yoanbernabeu/grepai) |
| 13 | [](LICENSE) |
| 14 | |
| 15 | **Search code by meaning, not just text.** |
| 16 | |
| 17 | [Documentation](https://yoanbernabeu.github.io/grepai/) · [Installation](#installation) · [Quick Start](#quick-start) |
| 18 | |
| 19 | </div> |
| 20 | |
| 21 | --- |
| 22 | |
| 23 | `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. |
| 24 | |
| 25 | **Drastically reduces AI agent input tokens** by providing relevant context instead of raw search results. |
| 26 | |
| 27 | ## Features |
| 28 | |
| 29 | - **Search by intent** — Ask "authentication logic" and find `handleUserSession` |
| 30 | - **Trace call graphs** — Know who calls a function before you change it |
| 31 | - **100% local** — Your code never leaves your machine |
| 32 | - **Always up-to-date** — File watcher keeps the index fresh automatically |
| 33 | - **AI agent ready** — Works with Claude Code, Cursor, Windsurf out of the box |
| 34 | - **MCP server** — Your AI agent can call grepai directly as a tool |
| 35 | |
| 36 | ## Installation |
| 37 | |
| 38 | **Homebrew (macOS):** |
| 39 | ```bash |
| 40 | brew install yoanbernabeu/tap/grepai |
| 41 | ``` |
| 42 | |
| 43 | **Linux/macOS:** |
| 44 | ```bash |
| 45 | curl -sSL https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.sh | sh |
| 46 | ``` |
| 47 | |
| 48 | **Windows (PowerShell):** |
| 49 | ```powershell |
| 50 | irm https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.ps1 | iex |
| 51 | ``` |
| 52 | |
| 53 | Requires an embedding provider — [Ollama](https://ollama.ai) (default), [LM Studio](https://lmstudio.ai), or OpenAI. |
| 54 | |
| 55 | **Ollama (recommended):** |
| 56 | ```bash |
| 57 | ollama pull nomic-embed-text |
| 58 | ``` |
| 59 | |
| 60 | ## Quick Start |
| 61 | |
| 62 | ```bash |
| 63 | grepai init # Initialize in your project |
| 64 | grepai watch # Start indexing daemon |
| 65 | grepai search "error handling" # Search semantically |
| 66 | grepai trace callers "Login" # Find who calls a function |
| 67 | ``` |
| 68 | |
| 69 | ## Shell Completion |
| 70 | |
| 71 | grepai supports autocompletion for commands, flags, and dynamic values (workspace names, project names, providers, backends). |
| 72 | |
| 73 | **Zsh (add to `~/.zshrc`):** |
| 74 | ```bash |
| 75 | eval "$(grepai completion zsh)" |
| 76 | ``` |
| 77 | |
| 78 | **Oh-My-Zsh plugin:** |
| 79 | ```bash |
| 80 | mkdir -p ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/grepai |
| 81 | grepai completion zsh > ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/grepai/_grepai |
| 82 | # Then add "grepai" to plugins=(...) in ~/.zshrc |
| 83 | ``` |
| 84 | |
| 85 | **Bash:** |
| 86 | ```bash |
| 87 | # Linux |
| 88 | grepai completion bash > /etc/bash_completion.d/grepai |
| 89 | |
| 90 | # macOS (requires bash-completion@2) |
| 91 | grepai completion bash > $(brew --prefix)/etc/bash_completion.d/grepai |
| 92 | ``` |
| 93 | |
| 94 | **Fish:** |
| 95 | ```bash |
| 96 | grepai completion fish > ~/.config/fish/completions/grepai.fish |
| 97 | ``` |
| 98 | |
| 99 | **PowerShell:** |
| 100 | ```powershell |
| 101 | grepai completion powershell | Out-String | Invoke-Expression |
| 102 | ``` |
| 103 | |
| 104 | ## What developers say |
| 105 | |
| 106 | > *"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."* |
| 107 | > — u/911pleasehold on [r/ClaudeAI](https://www.reddit.com/r/ClaudeAI/comments/1qiv0d3/open_source_i_reduced_claude_code_input_tokens_by/) (280K+ views) |
| 108 | |
| 109 | > *"It works great! Takes 5 minutes to install. Crazy!"* |
| 110 | > — [@LesSaleGeek](https://x.com/LesSaleGeek/status/2010335803604611124) on X |
| 111 | |
| 112 | > *"The results are incredible!"* |
| 113 | > — [Kenny Nguyen](https://www.linkedin.com/feed/update/urn:li:activity:741945188 |