mgrep-code-search by intellectronica/agent-skills
npx skills add https://github.com/intellectronica/agent-skills --skill mgrep-code-searchmgrep 是一个语义搜索工具,支持对代码、文本、PDF 和图像进行自然语言查询。它特别适用于探索传统模式匹配无法胜任的大型或复杂代码库。
在以下情况下使用 mgrep:
在以下情况下使用传统的 grep/ripgrep:
在搜索之前,启动监视器以索引代码库:
bunx @mixedbread/mgrep watch
watch 命令会索引代码库并保持与文件更改的同步。它遵循 .gitignore 和 .mgrepignore 模式。
bunx @mixedbread/mgrep "你的自然语言查询" [路径]
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
bunx @mixedbread/mgrep "认证配置在哪里?"
bunx @mixedbread/mgrep "我们如何处理 API 调用中的错误?" src/
bunx @mixedbread/mgrep "数据库连接设置" src/lib
| 选项 | 描述 |
|---|---|
-m <数量> | 最大结果数(默认:10) |
-c, --content | 显示完整结果内容 |
-a, --answer | 生成基于 AI 的结果综合摘要 |
-s, --sync | 搜索前更新索引 |
--no-rerank | 禁用相关性优化 |
# 获取更多结果
bunx @mixedbread/mgrep -m 25 "用户认证流程"
# 显示匹配项的完整内容
bunx @mixedbread/mgrep -c "错误处理模式"
# 获取 AI 综合的答案
bunx @mixedbread/mgrep -a "缓存层如何工作?"
# 搜索前同步索引
bunx @mixedbread/mgrep -s "支付处理" src/services
启动监视器(每次会话或文件发生重大更改时一次):
bunx @mixedbread/mgrep watch
进行语义搜索:
bunx @mixedbread/mgrep "你要找的内容" [可选/路径]
根据需要细化,使用路径约束或选项:
bunx @mixedbread/mgrep -m 20 -c "细化后的查询" src/特定/目录
通过环境变量配置默认值:
| 变量 | 用途 |
|---|---|
MGREP_MAX_COUNT | 默认结果限制 |
MGREP_CONTENT | 启用内容显示(1/true) |
MGREP_ANSWER | 启用 AI 综合(1/true) |
MGREP_SYNC | 搜索前同步(1/true) |
bunx @mixedbread/mgrep 来运行命令(不要使用 npm/npx 或直接安装)bunx @mixedbread/mgrep watch 以确保索引是最新的.gitignore 模式.mgrepignore 以添加额外的排除项每周安装量
224
代码仓库
GitHub 星标数
228
首次出现
2026 年 1 月 20 日
安全审计
安装于
opencode185
claude-code178
gemini-cli172
codex170
cursor159
github-copilot142
mgrep is a semantic search tool that enables natural language queries across code, text, PDFs, and images. It is particularly effective for exploring larger or complex codebases where traditional pattern matching falls short.
Use mgrep when:
Use traditional grep/ripgrep when:
Before searching, start the watcher to index the repository:
bunx @mixedbread/mgrep watch
The watch command indexes the repository and maintains synchronisation with file changes. It respects .gitignore and .mgrepignore patterns.
bunx @mixedbread/mgrep "your natural language query" [path]
bunx @mixedbread/mgrep "where is authentication configured?"
bunx @mixedbread/mgrep "how do we handle errors in API calls?" src/
bunx @mixedbread/mgrep "database connection setup" src/lib
| Option | Description |
|---|---|
-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 |
# 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
Start watcher (once per session or when files change significantly):
bunx @mixedbread/mgrep watch
Search semantically :
bunx @mixedbread/mgrep "what you're looking for" [optional/path]
Refine as needed using path constraints or options:
bunx @mixedbread/mgrep -m 20 -c "refined query" src/specific/directory
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) |
bunx @mixedbread/mgrep to run commands (not npm/npx or direct installation)bunx @mixedbread/mgrep watch before searching to ensure the index is current.gitignore patterns automatically.mgrepignore for additional exclusionsWeekly Installs
224
Repository
GitHub Stars
228
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode185
claude-code178
gemini-cli172
codex170
cursor159
github-copilot142
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
107,800 周安装