About this project

mgrep is a command-line tool that brings semantic, natural-language search to local files, positioned as a complement to grep rather than a replacement. It is distributed as an npm package (@mixedbread/mgrep) under the Apache-2.0 license and is built by Mixedbread. Core capabilities: - Natural-language search over code, text, PDFs and images. Audio and video support are described as coming soon. - Background indexing through `mgrep watch`, which performs an initial sync, respects .gitignore and an optional .mgrepignore file, and keeps a cloud-backed Mixedbread store updated as files change. - Web search via `--web`, which queries a `mixedbread/web` store alongside local results; `--answer` produces a summarized response. - Agentic search via `--agentic`, which breaks complex questions into sub-queries and runs multiple searches. - Reranking of results by default, disableable with `--no-rerank` or MGREP_RERANK=0. - Results include relative paths and contextual hints such as line ranges for text and page numbers for PDFs. Authentication and setup: - `mgrep login` uses a device/browser flow; headless or CI environments can set MXBAI_API_KEY instead. - Installation is via `npm install -g @mixedbread/mgrep` (pnpm/bun also mentioned). Coding agent integrations: - Assisted install commands exist for Claude Code, OpenCode, Codex and Factory Droid (install-claude-code, install-opencode, install-codex, install-droid). - The README notes that when installed with a coding agent, a background process syncs files during a session and stops when the session ends. - Default limits are 1MB per file and 1,000 files per directory, adjustable via CLI flags, environment variables or config files. Configuration: - Local `.mgreprc.yaml`/`.mgreprc.yml` or global `~/.config/mgrep/config.yaml`. - Precedence: CLI flags, then environment variables, then local config, then global config, then defaults. - Environment variables cover authentication (MXBAI_API_KEY), store selection (MXBAI_STORE), search behavior (MGREP_MAX_COUNT, MGREP_CONTENT, MGREP_ANSWER, MGREP_WEB, MGREP_AGENTIC, MGREP_SYNC, MGREP_DRY_RUN, MGREP_RERANK) and sync limits (MGREP_MAX_FILE_SIZE, MGREP_MAX_FILE_COUNT). - `--store <name>` isolates workspaces; stores are created on demand. Commands overview: `mgrep`/`mgrep search`, `mgrep watch`, `mgrep login`, `mgrep logout`, and the four agent install commands. Development: TypeScript project built with pnpm; `pnpm build`, `pnpm dev`, `pnpm format` (biome), `pnpm typecheck`; tests use bats. The README states tests are not fully wired up yet. Benchmark claim: the README reports an internal 50-task QA benchmark where mgrep with Claude Code used roughly 2x fewer tokens than grep-based workflows at similar or better judged quality, with win rate judged by an LLM. These are the project's own claims and are not independently verified here. Troubleshooting notes cover repeated login prompts, noisy watchers, and recreating a store. Support is offered through the Mixedbread Slack community.