Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI reference

Full reference for the aozora binary. For a guided tour, see CLI Quickstart.

Synopsis

aozora [OPTIONS] <SUBCOMMAND> [ARGS]

Subcommands:

SubcommandWhat it does
checkLex + report diagnostics.
fmtRound-trip parse ∘ serialize.
renderRender to HTML on stdout.

Global options apply to every subcommand:

OptionEffect
-E sjis, --encoding sjisDecode Shift_JIS source. Default is UTF-8.
--no-colorDisable ANSI colour in diagnostics output.
--verbosePrint parse phase timings to stderr.
--diagnostics LEVELFilter diagnostics by minimum level (error | warning | info). Default: warning.
-V, --versionPrint version and exit.
-h, --helpPrint help and exit.

aozora check

aozora check [OPTIONS] [PATH]

Lex the source and print diagnostics. PATH of - (or omitted) reads from stdin.

OptionEffect
--strictExit non-zero on any diagnostic.

Exit codes: 0 on parse success (regardless of diagnostics, unless --strict); 1 on diagnostics under --strict; 2 on usage error.

aozora check src.txt                # warnings shown, exit 0
aozora check --strict src.txt       # warnings -> exit 1
aozora check -E sjis crime.txt      # SJIS source
cat src.txt | aozora check          # stdin

aozora fmt

aozora fmt [OPTIONS] [PATH]

Round-trip the source through parse ∘ serialize. Default behaviour prints the canonical form on stdout.

OptionEffect
--checkExit non-zero if the formatted output differs from the input. Don’t print the canonical form.
--writeOverwrite the input file with the canonical form. (Ignored when reading from stdin.)

Exit codes: 0 on success (or no diff under --check); 1 on a formatting mismatch under --check; 2 on usage error.

aozora fmt src.txt > formatted.txt
aozora fmt --check src.txt          # CI gate
aozora fmt --write src.txt          # in-place
cat src.txt | aozora fmt            # stdin → stdout

aozora render

aozora render [OPTIONS] [PATH]

Render the parsed tree to HTML on stdout.

aozora render src.txt > out.html
aozora render -E sjis crime.txt > crime.html
cat src.txt | aozora render -

The output is semantic HTML5 with aozora-* class hooks (no inline styles). See HTML renderer for the class-name reference.

Exit codes

CodeMeaning
0Success.
1Diagnostics emitted under --strict, or formatting mismatch under --check.
2Usage error (bad flag, missing file, decode error).

Environment

VariableEffect
NO_COLORIf set (any value), disable ANSI colour output. Same as --no-color.
AOZORA_LOGtracing-subscriber filter (e.g. aozora_pipeline=debug). For internal debugging; not part of the stable surface.

See Reference → Environment variables for the full env matrix (which includes the bench / profiling vars).

See also