Built-in tools›Files and search
Search content
grep- Group
- Files and search
- Turned on by
- Its own switch on the Tools page of Conversation settings.
- Approval
- Not reviewed: runs without asking, within the limits on this page.
- Profile key
tool.grep.description
Searches file contents with a regular expression and returns each matching line with its file and line number.
Matching ignores case by default and works one line at a time, so a pattern cannot span lines. The syntax has no look-around and no backreferences.
Limits
- Files over 2 MiB, binary files and links are skipped. Each reported line is cut at 500 characters.
- A result over 20,000 characters is saved to a file in Mework's app-data folder. The model gets the first 2,000 characters and the file's path.
Good to know
- It searches what Git would show: tracked files, and untracked files Git does not ignore. Outside a Git repository, dependency and build folders such as
node_modulesandtargetare skipped. A single file named aspathis always searched. - You can change a recorded
grepcall in the timeline and run it again with Rerun.
Parameters
| Parameter | Type | Details |
|---|---|---|
pattern requiredSearch pattern | string | Regular expression to match against each line. |
case_sensitiveCase sensitive | boolean | Match case-sensitively. Default false |
limitLimit | integer | Most matching lines to return. Default 250 |
offsetOffset | integer | Matching lines to skip first, to fetch the next page. Default 0 |
pathPath | string | File or directory to search, relative to the workspace. Default "." |