glob(
self,
pattern: str,
path: str | None = None,
) -> GlobResult| Name | Type | Description |
|---|---|---|
pattern* | str | Glob pattern with wildcards to match file paths. Supports:
|
path | str | None | Default: NoneOptional base directory to search from. If omitted, the backend chooses its default search root. The pattern is applied relative to this path. |
Find files matching a glob pattern.
Pattern matching follows the shared backend contract (aligned with grep include-glob, not classic non-recursive shell globbing):
Patterns without / match the basename at any depth under path.
Example: *.py matches src/app/main.py.
Patterns containing / match paths relative to the search root, with
** support.
Example: src/**/*.py matches src/app/main.py.
A leading / anchors the pattern to the search root; it narrows the
match rather than widening it.
Example: /*.py matches top.py but not src/app/main.py.
Leading-dot names match only when the pattern segment itself starts
with .. Since ** will not descend into dot-directories, a bare
pattern is broader than its **/ form.
Example: *.yml matches .github/workflows/ci.yml; **/*.yml
does not. .env matches .env; * does not.
Only regular files are returned; directories are never matched.