Grep across a site's files
search_filesSearch for a literal string or basic regex across all files in either the served dist or the editable source tree. Use this BEFORE batch-reading files to find candidates — saves the 'read 14 batches just to find which 3 files matter' round trip. Pass target: "source" to search the editable tree (requires Site.sourceStored=true).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Filename glob filter, e.g. '*.js' or '*.{js,html}'. Applied via find before grep so we don't read non-matching files. | |
| name | No | ||
| regex | No | When true, the pattern is interpreted as a basic regular expression. Default: false (literal substring match). | |
| siteId | No | ||
| target | No | Where to search. 'dist' (default) searches the served files. 'source' searches the editable source tree (requires Site.sourceStored=true). | |
| pattern | Yes | Pattern to search for. Treated literal by default; pass regex:true to use as a basic regex (BusyBox grep BRE — no PCRE features). | |
| maxMatches | No | Cap on returned matches. Default 200, hard max 1000. Truncation is reported via budgetExceeded. | |
| caseInsensitive | No | Default: false. When true, adds -i to grep. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| siteId | Yes | ||
| target | Yes | ||
| matches | Yes | ||
| request_id | No | Server-assigned request correlation id. Quote it when contacting support. | |
| totalMatches | Yes | ||
| budgetExceeded | Yes | True if the search hit maxMatches and there are likely more matches not returned. |