grep
Search file contents with a regular expression (RE2 syntax, no backreferences or lookaround). Omit both path and prefix to search every text file in the workspace; pass prefix to search one folder, or path to search a single file. Returns matching lines with 1-based line numbers and surrounding context; line numbers are display-only, never include them in edit's old_str. Matches within single lines only. Use grep to locate exact text; use read to view the surrounding region.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Search a single file at this path instead of a folder. | |
| prefix | No | Search only files under this folder. Omit both path and prefix to search the whole workspace. | |
| pattern | Yes | RE2 regular expression. No backreferences or lookaround. | |
| workspace | No | Workspace slug. Optional, defaults to "temp". | |
| max_matches | No | Stop after this many matches. | |
| context_lines | No | Lines of surrounding context to return around each match. | |
| case_sensitive | No | Match case exactly. |