Search file contents for literal text pattern.
Performs literal text search.
grepSearchFiles(
files: Record<string, FileData>,
pattern: string,
path: string | null = null,
glob: string | null = null,
outputMode: "content" | "files_with_matches" | "count" = "files_with_matches"
): string| Name | Type | Description |
|---|---|---|
files* | Record<string, FileData> | Dictionary of file paths to FileData |
pattern* | string | Literal text to search for |
path | string | null | Default: nullBase path to search from |
glob | string | null | Default: nullOptional glob pattern to filter files (e.g., "*.py") |
outputMode | "content" | "files_with_matches" | "count" | Default: "files_with_matches"Output format - "files_with_matches", "content", or "count" |
const files = {"/file.py": FileData({content: ["import os", "print('hi')"], ...})};
grepSearchFiles(files, "import", "/");
// Returns: "/file.py" (with output_mode="files_with_matches")