Grep
Search file content via ripgrep. Returns matches in the chosen output mode.
Schema
Section titled “Schema”| Param | Type | Required | Default | Notes |
|---|---|---|---|---|
pattern | string | yes | — | Rust regex syntax (ripgrep’s engine). |
path | string | no | workspace root | File or directory to search. |
glob | string | no | — | File filter, e.g. "*.go". |
case_insensitive | boolean | no | false | Adds -i. |
output_mode | string | no | "content" | One of "content", "files_with_matches", "count". |
head_limit | number | no | unlimited | Truncate output to this many lines. 0 means no limit. |
Output modes
Section titled “Output modes”content— one match per line:path:line:textfiles_with_matches— one path per line (files that have at least one match)count— one line per file:path:count
Behaviour
Section titled “Behaviour”.gitignoreis honored (viarg --no-require-gitso it works outside a git repo too).- Always runs with cwd = workspace root, so paths in output are workspace-relative.
- Invalid regex returns an error result wrapping ripgrep’s stderr.
- No matches returns an empty text result (not an error).
head_limitis applied client-side after ripgrep returns; forcountandfiles_with_matchesit bounds the number of files reported.
Example
Section titled “Example”Pattern: TODO, output mode: content, glob: *.go
cmd/sandbox/main.go:42:// TODO: handle signal cleanupinternal/tools/bash.go:120:// TODO: consider per-shell max-runtime