glob
Search for files matching a glob pattern. Supports wildcards like *, **, ?, [abc], etc.
Examples:
- "*.ts" - All TypeScript files in current directory
- "**/*.test.ts" - All test files recursively
- "src/**/*.{ts,tsx}" - TypeScript/TSX files in src/
- "*.{js,json}" - JS and JSON files
Returns up to 100 matching file paths. Read-only: it never changes the workspace and never asks for approval.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern |
string |
Yes | The glob pattern to match files against (e.g., '/*.ts', 'src//*.json') |
path |
string |
No | The directory to search in. If not specified, uses current working directory. Must be a valid directory path if provided. |
Example#
glob({ pattern: "…" })
Approval#
Runs without asking. Reads only; never changes the workspace.
See also#
- Tools — every tool, and which of them can change your files
- Approval modes — what gates the tools that change things
Added in woopcode@0.6.0