CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

ripgrep-all

$ rga 社区开源 低风险
phiresky · 文件检索与编辑 · AGPL-3.0-or-later · macos / linux / windows

ripgrep-all(rga)通过可插拔适配器扩展 ripgrep,支持搜索 PDF、.docx/.xlsx/.pptx、EPUB、压缩包、SQLite 数据库及字幕文本。支持透传 --json、--color=never 等 ripgrep 参数,并在本地缓存提取文本。

FCRS-1.0 综合评分
85 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install ripgrep-all
CLI vs MCP 选型建议 仅 CLI 可用

直接使用 rga --json 在本地检索二进制文档与归档文件,无需启动 MCP 服务。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
✓ 只读模式开关
✓ 支持 NO_COLOR
— 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 22 / 25

继承 ripgrep 的 --json JSON Lines 输出、--color=never、非交互执行与标准退出码。

  • Passes --json and standard rg flags to ripgrep
  • Non-interactive adapter pipeline with --rga-adapters control
安全与权限边界 22 / 25

对目标文档只读检索,但会调用外部适配器程序(如 pdftotext、ffmpeg)并在未开启 --rga-no-cache 时写入本地缓存。

  • Never modifies target files
  • Caches extracted text locally under ~/.cache/rga by default
安装与运行摩擦 12 / 15

可通过 brew install ripgrep-all 与 cargo install ripgrep_all 安装,但完整格式支持依赖 rg 及 poppler、pandoc、ffmpeg 等外部工具。

  • Depends on ripgrep and format-specific helper binaries on PATH
能力覆盖与边际价值 13 / 15

单条命令即可对 PDF、Office 文档、压缩包与 SQLite 数据库执行全文正则搜索。

  • Replaces ad-hoc Python/pdftotext extraction loops
维护与来源背书 8 / 10

由 phiresky 维护的知名 Rust 开源项目,采用 AGPL-3.0-or-later 协议。

  • Active phiresky/ripgrep-all GitHub repository
文档与可验证性 8 / 10

README 与 --help 对适配器、缓存机制及 rg 参数透传说明清晰。

  • Adapter list and examples documented in README and --rga-list-adapters

安全边界、鉴权与放权指南

鉴权方式
无需鉴权
凭证存储位置

无需凭据;默认会将提取的纯文本缓存在 ~/.cache/rga,传入 --rga-no-cache 可禁用。

潜在副作用
只读查询
费用与配额提示

100% 免费、离线、开源(AGPL-3.0-or-later)。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# ripgrep-all (rga) Agent Rules
- Pass `--json` (inherited from `rg`) and `--rga-no-cache` if searching sensitive documents you should not cache on disk.
- Scope searches to targeted directories and disable unneeded slow adapters with `--rga-adapters=-...`.

Agent 高频安全命令配方

只读查询(安全推荐)

以 JSON Lines 格式搜索 PDF 与文档
rga --json "quarterly revenue" ./reports

通过适配器提取受支持文档的文本,并输出兼容 ripgrep 的 JSON Lines 匹配结果。

使用魔数检测并过滤适配器
rga --rga-accurate --rga-adapters=-sqlite --json "token" ./artifacts

通过 --rga-accurate 按文件内容魔数识别格式,同时禁用 SQLite 适配器。

核心优势

  • + 在 PDF、Office 文档、压缩包与 SQLite 检索中直接继承 ripgrep 的 --json 结构化输出。
  • + 本地缓存机制显著加速大型文档目录的重复查询。

注意事项与踩坑点

  • ! 部分适配器依赖系统中已安装 ripgrep(rg)及 pdftotext、ffmpeg 等外部工具。
  • ! 默认会在 ~/.cache/rga 缓存提取文本;检索敏感文件时请传入 --rga-no-cache。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI