CLI
Look up every command and flag, and how they combine.
Usage
Usage: stanza (--fix | --check) [--changed [--hunks] | --stdin <path> | [--] <paths...>] [--json] [--braces | --no-braces]
stanza --check --staged [--hunks] [--json] [--braces | --no-braces]
stanza explain [--no-braces] [--] <file>:<line>
stanza hook [--braces | --no-braces] [--hunks]Flags
The flags, as stanza --help prints them:
| flag | what it does |
|---|---|
--fix | apply every deterministic rule in place |
--check | report only, change nothing |
--changed | files from git diff --name-only HEAD plus untracked files |
--hunks | with --changed or --staged, only gaps and blocks touching changed lines |
--staged | the staged content of staged files, for pre-commit |
--stdin <path> | source on stdin; --fix: fixed text on stdout, findings on stderr; --check: findings on stdout |
--json | findings as a JSON array |
--braces | turn on the braces rule even when lint config turns it off or cannot be read |
--no-braces | turn off the braces rule, keep the blank line rules |
explain <file>:<line> | which rule decides the gap or braced body at that line, and why |
hook | Stop and SubagentStop; PostToolUse on Edit, MultiEdit and Codex apply_patch; PreToolUse on Write; reads JSON on stdin |
--help | usage, flags and the rule catalog |
--version | the version, and for a built binary the commit it was built from |
-h is the same as --help. --help and --version take no other arguments.
Environment
AGENT_HOOKS=0 turns the hook off.
STANZA_WORKERS sets the worker thread count. It accepts only digits representing an unsigned integer from 0 to 64 inclusive. 0 runs serially on the main thread, without worker threads. Any accepted value applies at any file count, even below 64 files.
Invalid or out-of-range values are ignored. Without an accepted value, a run of fewer than 64 files is serial and a run of 64 files or more uses one worker thread fewer than the available parallelism, up to eight.
Only runs over path arguments or --changed can use worker threads. --staged, --stdin and hook runs never do.
Combining Flags
| combination | what happens |
|---|---|
neither --fix nor --check, or both | usage error |
none of paths, --changed, --staged and --stdin | usage error, nothing to format |
more than one of paths, --changed, --staged and --stdin | usage error |
--staged with --fix | usage error, --staged works only with --check |
--hunks without --changed or --staged | usage error |
both --braces and --no-braces | usage error |
| the same flag twice | usage error |
a path that starts with - | put -- before it; everything after -- is a path |
A usage error prints the problem and the usage on stderr and exits 2. stanza hook checks its own arguments and exits 1 instead, see Hook Protocol.