ast-grep adds outline extraction and an outline CLI
Introduced 2026-06-22 · score 0.97
HOW TO USE IT
To inspect a file or directory’s structure, run `ast-grep outline` on the target path; bundled outline rules are used automatically. Choose `--items` and `--view` to narrow the output, and use `--outline-rules` only to add extractor definitions.
ast-grep outline <file>ast-grep outline <directory> --items exportsast-grep outline <path> --outline-rules <rules.yml>WHY THIS HELPS
Inspect source files in a repository using ast-grep's outline extraction.
REQUIREMENTS AND LIMITATIONS
- Version: 0.44.0
- <file> / <directory> (PATHS): Path or paths to search; defaults to the current directory.
- --items <ITEMS>: Select top-level entries: `auto`, `structure`, `exports`, `imports`, or `all`. `auto` adapts to input; directory input defaults to exports.
- --view <VIEW>: Select output detail: `auto`, `names`, `signatures`, `digest`, or `expanded`. These values are alternatives; `auto` uses names for directories and digest for files or stdin.
- --outline-rules <FILE>: Load additional extractor definitions from a stream of YAML documents; rules supplement bundled rules and configured custom-language rules.
- --no-default-outline-rules: Disable bundled extractor definitions; combine with `--outline-rules` to replace the built-in catalog.
- Prerequisite: The outline command was introduced in ast-grep 0.44.0 as an alpha preview.
FIRST-PARTY EVIDENCE
- https://github.com/ast-grep/ast-grep/releases/tag/0.44.0
- https://ast-grep.github.io/guide/outline-code
- https://ast-grep.github.io/reference/cli/outline
Check the installed version and the source before using it. Entry JSON