|
1 | 1 | # xgrep |
2 | 2 |
|
| 3 | +[](https://github.com/momokun7/xgrep/actions/workflows/ci.yml) |
| 4 | +[](https://crates.io/crates/xgrep-search) |
| 5 | +[](LICENSE) |
| 6 | + |
3 | 7 | Ultra-fast indexed code search engine with MCP server for AI coding tools. |
4 | 8 |
|
5 | 9 | Pre-builds a trigram inverted index, then searches in milliseconds. Designed for repeated searches on large codebases — by humans and AI agents alike. |
6 | 10 |
|
| 11 | +## Features |
| 12 | + |
| 13 | +- **Indexed search** — trigram inverted index makes repeated searches 2-59x faster than ripgrep |
| 14 | +- **File discovery** — `--find` mode locates files 4-36x faster than fd/find |
| 15 | +- **MCP server** — built-in [Model Context Protocol](https://modelcontextprotocol.io/) server for AI coding tools (Claude Code, Cursor, etc.) |
| 16 | +- **LLM-optimized output** — `--format llm` produces Markdown with language tags, context lines, and token-aware truncation |
| 17 | +- **Git-aware** — search only changed files (`--changed`), recent commits (`--since 1h`), respects `.gitignore` |
| 18 | +- **Zero config** — `cargo install xgrep-search`, then `xg "pattern"`. Index builds automatically on first search |
| 19 | +- **Hybrid search** — serves results from index instantly while rebuilding in the background |
| 20 | + |
7 | 21 | ## Why xgrep? |
8 | 22 |
|
9 | 23 | | | ripgrep | zoekt | xgrep | |
@@ -258,6 +272,10 @@ Follows the same convention as ripgrep. |
258 | 272 | 3. **Hybrid Mode**: When the index is stale, combines index results with direct scanning of changed files — no rebuild needed |
259 | 273 | 4. **MCP Server**: Exposes search via JSON-RPC over stdio, with LLM-optimized output and token-aware truncation |
260 | 274 |
|
| 275 | +## Contributing |
| 276 | + |
| 277 | +See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines. |
| 278 | + |
261 | 279 | ## License |
262 | 280 |
|
263 | 281 | MIT |
0 commit comments