Ripgrep Search Count
search-countCount how many times a regex pattern appears in each file. Returns file paths with match totals to analyze code or text distribution.
Instructions
Count pattern matches per file using ripgrep. Returns file paths with their match counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Glob pattern to filter files | |
| path | Yes | Directory or file to search | |
| sortBy | No | Sort results: 'path' (alphabetical), 'count' (descending), 'count-asc' (ascending) | |
| pattern | Yes | Search pattern (regex by default) | |
| fileType | No | Filter by file type (e.g. 'ts', 'py') | |
| maxDepth | No | Maximum directory traversal depth | |
| noIgnore | No | Do NOT respect .gitignore rules (search files that are normally ignored) | |
| countMode | No | 'lines' counts matching lines (default), 'matches' counts all matches including multiple per line | |
| wordMatch | No | Only match whole words | |
| fileTypeNot | No | Exclude file type | |
| includeZero | No | Include files with zero matches in the output | |
| fixedStrings | No | Treat pattern as a literal string | |
| caseSensitive | No | true = case-sensitive, false = case-insensitive, omit = smart-case | |
| includeHidden | No | Include hidden files and directories | |
| maxCharacters | No | Maximum characters in the result. Truncated with summary if exceeded. | |
| followSymlinks | No | Follow symbolic links |