ripgrep-all
$ rga 社区开源 低风险ripgrep-all(rga)通过可插拔适配器扩展 ripgrep,支持搜索 PDF、.docx/.xlsx/.pptx、EPUB、压缩包、SQLite 数据库及字幕文本。支持透传 --json、--color=never 等 ripgrep 参数,并在本地缓存提取文本。
brew install ripgrep-all 直接使用 rga --json 在本地检索二进制文档与归档文件,无需启动 MCP 服务。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
继承 ripgrep 的 --json JSON Lines 输出、--color=never、非交互执行与标准退出码。
- Passes
--jsonand standardrgflags toripgrep - Non-interactive adapter pipeline with
--rga-adapterscontrol
对目标文档只读检索,但会调用外部适配器程序(如 pdftotext、ffmpeg)并在未开启 --rga-no-cache 时写入本地缓存。
- Never modifies target files
- Caches extracted text locally under
~/.cache/rgaby default
可通过 brew install ripgrep-all 与 cargo install ripgrep_all 安装,但完整格式支持依赖 rg 及 poppler、pandoc、ffmpeg 等外部工具。
- Depends on
ripgrepand format-specific helper binaries on PATH
单条命令即可对 PDF、Office 文档、压缩包与 SQLite 数据库执行全文正则搜索。
- Replaces ad-hoc Python/pdftotext extraction loops
由 phiresky 维护的知名 Rust 开源项目,采用 AGPL-3.0-or-later 协议。
- Active
phiresky/ripgrep-allGitHub repository
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)。
# 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 高频安全命令配方
只读查询(安全推荐)
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。