For AI agents: the complete documentation index is available at https://lazygophers.github.io/pamphlet/en/llms.txt, the full documentation bundle is available at https://lazygophers.github.io/pamphlet/en/llms-full.txt, and this page is available as Markdown at https://lazygophers.github.io/pamphlet/en/reference/cli/ast.md.

ast

Print the syntax tree parsed out of a document.

pamphlet ast plan.md

Writes { path, frontmatter, ast, diagnostics } as JSON to stdout.

One file at a time; a glob matching several errors with exit 2.

The AST is unstable during 0.x

Its shape carries no compatibility promise and can change in a minor release. Do not build tools against it as a stable interface. See the compatibility promise on the install page.

Flags that do nothing here

FlagActual behaviour
--format jsonIt already emits JSON. The flag only stops it printing human-readable diagnostics to stderr
--fail-on-warnIgnored
--continue-on-errorIgnored (it only ever takes one file)

When it is useful

Debugging. When a directive is not doing what you expect, ast shows exactly what the parser made of it.

Day-to-day writing never needs it.