ripgrep
CLI>=13.0Recursively searches directories for a regex pattern, respecting .gitignore.
Blazing-fast regex search across files, respects .gitignore
Recipes
Curated from documentation and usage. Percentages are estimates, not measurements.
Search for pattern in all files
rg 'pattern' .Search only in specific file type
rg 'pattern' --type ts .Search case-insensitive
rg -i 'pattern' .List files containing pattern
rg -l 'pattern' .Install
Homebrew
brew install ripgrepCargo
cargo install ripgrepAgent notes
- When to use
- Searching codebases or large directory trees for patterns
- Quick examples
rg 'fn main' src/rg -l 'TODO' .
Use from an agent
curl -s https://clihub.com/api/tools/ripgrep | jq '.agentHints.provenRecipes[] | {task, command, verified}'Or call get_tool with slug ripgrep on the MCP server at https://clihub.com/mcp.