Skip to main content

grep

Search for regex patterns across files in the project.

Parameters

ParameterTypeRequiredDescription
patternstringYesRegex pattern to search for
pathstringNoDirectory or file to search in (defaults to working directory)
includestringNoFile glob to filter results (e.g. *.rs, *.ts)

Features

  • Uses Rust regex syntax
  • Returns matching lines with file paths and line numbers
  • Caps results at 200 matches to keep responses manageable
  • Skips binary files and common non-text extensions (.png, .jpg, .exe, .dll, etc.)

Examples

Search for a function definition:
{
  "pattern": "fn\\s+build_system_prompt",
  "include": "*.rs"
}
Search for TODO comments in a specific directory:
{
  "pattern": "TODO|FIXME|HACK",
  "path": "src/"
}
Search for import statements:
{
  "pattern": "^use\\s+crate::",
  "include": "*.rs"
}

glob

Find files matching a glob pattern.

Parameters

ParameterTypeRequiredDescription
patternstringYesGlob pattern to match
pathstringNoDirectory to search in (defaults to working directory)

Pattern Syntax

PatternMeaning
*Match any characters (except /)
**Match any directories recursively
?Match any single character
[abc]Match any character in the set
[a-z]Match any character in the range

Examples

Find all Rust source files:
{
  "pattern": "**/*.rs"
}
Find test files:
{
  "pattern": "**/test*.rs"
}
Find files in a specific directory:
{
  "pattern": "*.toml",
  "path": "crates/"
}
Find configuration files:
{
  "pattern": "**/*.{json,yaml,yml,toml}"
}