CLI Finder / tools / ripgrep

用于快速仓库搜索的 ripgrep

高速递归搜索 CLI,帮助 Agent 定位代码路径、文档、测试和既有模式。

Agent 适配度: 94/100 持续维护
94 /100

A safe default discovery tool for coding agents because it is fast, read-only, and scriptable.

Structured output 86/100

Whether the CLI can return JSON, YAML, or stable machine-readable output.

Non-interactive use 98/100

Whether common workflows can run predictably without an interactive prompt.

Safety boundaries 96/100

Whether read-only, dry-run, scoped auth, and destructive command boundaries are clear.

安装方式

Homebrew $ brew install ripgrep
Debian/Ubuntu $ sudo apt install ripgrep

常用命令

Search code · 安全 $ rg "functionName" src

Finds matching source lines quickly.

JSON search · 安全 $ rg --json "TODO" src

Returns machine-readable search events.

Agent 使用示例

Codex CLI Use rg before editing to find existing patterns, helpers, and tests. Prefer scoped searches over full-repo broad queries.

安全说明

  • ripgrep is read-only and safe for repository exploration.
  • Agents should use narrow paths and patterns to avoid noisy results.

Agent 可以用它做什么

ripgrep 是编程 Agent 最安全的第一批工具之一:只读、快速,并适合大型仓库。

适合场景

适合编辑前检索、代码 Review 和追踪功能归属。