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/index.md.

Command line

pamphlet build   <path...> [options]   compile to a single HTML file
pamphlet serve   <path>    [options]   local preview, reloads on source change
pamphlet lint    <path...> [options]   check syntax and report diagnostics
pamphlet ast     <path>    [options]   print the AST as JSON
pamphlet extract <output.html>         recover the source from an output file
pamphlet doctor                        which diagram engines are installed

Without installing, prefix with npx @nekoleapuki/pamphlet-cli, e.g. npx @nekoleapuki/pamphlet-cli build plan.md.

Exit codes

CodeMeaning
0success
1compile error
2argument or usage error
3environment missing (doctor found an engine absent)

CI can judge on the exit code alone without parsing output.

Running pamphlet with no arguments prints usage and exits 2 — "you didn't say what to do" is a usage error, not a success.

Options

OptionApplies toMeaning
-o <path>, --out <path>buildWhere the output goes. Single file only; several sources errors with 2
--theme <name>build serveSwitch theme, overriding frontmatter theme. The six are in Built-in themes
--font <font file>buildEmbed this font, keeping only the glyphs used
--verbosebuildPrint a size breakdown after compiling
--no-embed-sourcebuildDo not embed the source (extract stops working)
--port <port>serveDefault 4321
--format jsonlint onlyStructured output for CI and editors
--fail-on-warnbuild lintTreat warnings as failures
--continue-on-errorbuild lintKeep going after a document fails
--no-colorallNo colour
-h, --helpallUsage
Warning

--format json is not a global option Only lint actually switches output format on it.

build ignores it and always prints human-readable diagnostics; ast already writes JSON to stdout, and the flag merely stops it printing human-readable diagnostics to stderr.

Likewise --fail-on-warn and --continue-on-error have no effect on ast.

Compiler messages are Chinese-only

There is no message localisation yet. Codes, positions and documentation links are language-independent; the prose is not. Output shown on this page is verbatim, not translated.

Environment variables

VariableEffect
NO_COLORIf set, disables colour, same as --no-color. A cross-tool convention (https://no-color.org/)