grep
Search file contents in a Bitbucket repository using regex patterns. Control output with modes for content, file paths, or match counts.
Instructions
Regex search file contents across a repository, like ripgrep on a local clone. Supports content/files/count modes, filename glob, path filtering, context lines, and case-insensitive search. One archive download per repo+commit, streamed in constant memory, cached in-process.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA to search (default: default branch) | |
| glob | No | Filename glob filter (e.g., '*.ts', '*.java', 'src/**') | |
| mode | No | Search mode: 'content' (matching lines with optional context), 'files' (list matching file paths), 'count' (match count per file) | |
| path | No | Directory path prefix to limit search scope (e.g., 'src/main') | |
| query | Yes | Regex pattern to search for in file contents | |
| repoSlug | Yes | The repository slug | |
| projectKey | Yes | The project key (e.g., PROJ) | |
| max_results | No | Maximum number of results to return (default: 200) | |
| context_lines | No | Number of context lines before/after each match in content mode (default: 0) | |
| case_insensitive | No | Case-insensitive search (default: false) |