Recursive regex search CLI with ignore-file awareness, glob and type filters, and optional JSON Lines output.
$brew install ripgrep
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
ripgrep is a recursive text search CLI for code and other file trees. It combines regex search with ignore-file awareness, glob and file-type filters, and a structured output mode for downstream tooling.
What It Enables
- Search large repos or directories without manually excluding ignored, hidden, or binary content unless you explicitly want to.
- Narrow searches by glob, file type, encoding, compressed file content, or a custom preprocessor when plain recursive grep is too blunt.
- Feed match locations, context, and per-file summaries into scripts or agents through JSON Lines output for follow-up edits, triage, or reporting.
Agent Fit
--jsonemits machine-readable begin, match, context, end, and summary messages, including offsets and safe handling for non-UTF-8 paths or bytes.- Non-interactive flags, predictable search behavior, and path or type filtering make it a strong primitive for CI checks, codebase audits, and search-then-edit loops.
- It is inspection-first: ripgrep does not modify files, and some alternate output modes such as file lists or counts cannot be combined with JSON.
Caveats
- Default filtering can hide expected matches until you add flags like
-u,--hidden,--text, or--follow. - Matching is line-oriented by default; multiline or PCRE2-heavy searches are opt-in and can cost performance.