Search file contents for literal text pattern.
Performs literal text search.
grepSearchFiles(
files: Record<string, FileData>,
pattern: string,
path: string | null = null,
glob:| 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. If |
glob | string | null | Default: null |
outputMode | "content" | "files_with_matches" | "count" | Default: "files_with_matches" |
const files = {"/file.py": FileData({content: ["import os", "print('hi')"], ...})};
grepSearchFiles(files, "import", "/");
// Returns: "/file.py" (with output_mode="files_with_matches")Optional glob pattern to filter files (e.g., "*.py")
Output format - "files_with_matches", "content", or "count"