grep
Search file contents for a pattern and return matching lines with file paths and line numbers. Respects .gitignore and truncates long lines for manageable results.
Instructions
Search file contents for a pattern. Returns matching lines with file paths and line numbers. Respects .gitignore. Output is truncated to 100 matches or 50KB (whichever is hit first). Long lines are truncated to 500 chars.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Filter files by glob pattern, e.g. '*.ts' or '**/*.spec.ts' | |
| path | No | Directory or file to search (default: current directory) | |
| limit | No | Maximum number of matches to return (default: 100) | |
| context | No | Number of lines to show before and after each match (default: 0) | |
| literal | No | Treat pattern as literal string instead of regex (default: false) | |
| pattern | Yes | Search pattern (regex or literal string) | |
| ignoreCase | No | Case-insensitive search (default: false) |