Files
workbench__grep
Searches file contents in the project directory with a regular expression.
- Returns matching lines with their path and line number.
- Skips gitignored and binary files.
| Available to | Effect |
|---|---|
| Workbench agents only | Read-only |
Input
case_insensitiveboolean
Case-insensitive matching. Default false.
globstring
Only search matching files, e.g. .rs (file name) or src/**/.rs (relative path).
max_matchesinteger
Stop after this many matches. Default 100, cap 500.
pathstring
File or directory to search. Default: the project directory.
Rust regex matched against each line.
Output
matchCountinteger
matchesobject[]
matches.[].lineinteger
matches.[].pathstring
matches.[].textstring
truncatedboolean
{
"matchCount": 1,
"matches": [
{
"line": 42,
"path": "crates/dive-core/src/tools.rs",
"text": "pub struct ToolDef {"
}
],
"truncated": false
}