Mgrep code search

From mkurman/zorai · View interactive version

Mgrep code search is an AI agent skill from the GitHub repository mkurman/zorai. Semantic code search using mgrep for efficient codebase exploration. This skill should be used when searching or exploring codebases with more than 30 non-gitignored files and/or nested directory structures. It provides natural language semantic search that complements traditional grep/ripgrep for f

How to use this skill

Skill file

--|-------------|

| -m <count> | Maximum results (default: 10) |

| -c, --content | Display full result content |

| -a, --answer | Generate AI-powered synthesis of results |

| -s, --sync | Update index before searching |

| --no-rerank | Disable relevance optimisation |

Examples with Options

# Get more results
bunx @mixedbread/mgrep -m 25 "user authentication flow"

# Show full content of matches
bunx @mixedbread/mgrep -c "error handling patterns"

# Get an AI-synthesised answer
bunx @mixedbread/mgrep -a "how does the caching layer work?"

# Sync index before searching
bunx @mixedbread/mgrep -s "payment processing" src/services

Workflow

  1. Start watcher (once per session or when files change significantly):

```bash

bunx @mixedbread/mgrep watch

```

  1. Search semantically:

```bash

bunx @mixedbread/mgrep "what you're looking for" [optional/path]

```

  1. Refine as needed using path constraints or options:

```bash

bunx @mixedbread/mgrep -m 20 -c "refined query" src/specific/directory

```

Environment Variables

Configure defaults via environment variables:

| Variable | Purpose |

|----------|---------|

| MGREP_MAX_COUNT | Default result limit |

| MGREP_CONTENT | Enable content display (1/true) |

| MGREP_ANSWER | Enable AI synthesis (1/true) |

| MGREP_SYNC | Pre-search sync (1/true) |

Important Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.