ast-grep supports --files-with-matches
Introduced 2026-01-05 · score 0.95
HOW TO USE IT
When you need matching file names for a structural search, run ast-grep with `--files-with-matches` and provide a pattern, language, and repository path.
ast-grep run --pattern '<AST pattern>' --lang <language> --files-with-matches <repository-path>WHY THIS HELPS
List the files in a repository that match an ast-grep search.
REQUIREMENTS AND LIMITATIONS
- Version: 0.40.4
- --pattern <PATTERN> (required): AST pattern to match.
- --lang <LANG>: Language of the pattern.
- [PATHS]...: Paths to search; multiple paths are space-separated and default to `.`.
- --files-with-matches: Lists matching files, like ripgrep.
FIRST-PARTY EVIDENCE
- https://github.com/ast-grep/ast-grep/releases/tag/0.40.4
- https://ast-grep.github.io/reference/cli/run
Check the installed version and the source before using it. Entry JSON