This page documents all CLI options and shows practical examples. STAN’s CLI honors phase‑scoped defaults from your configuration (cliDefaults) when flags are omitted; see “Config‑driven defaults” below.
Enable or disable verbose debug logging (default from config; built‑in default false).
When enabled, some child process output is mirrored to the console.
-b, --boring / -B, --no-boring
Disable or enable all color/styling (default from config; built‑in default false).
When boring mode is on, STAN also sets NO_COLOR=1 and FORCE_COLOR=0.
-v, --version
Print extended version and baseline‑docs status:
STAN version, Node version, repo root, stanPath,
whether your local system prompt matches the packaged baseline,
docs baseline version last installed.
Example:
stan -v
If you run stan with no subcommand and no config is found, STAN starts interactive init. Otherwise it prints the help (with a footer listing available run scripts).
Run — options and defaults
By default (built‑ins), stan run:
runs all configured scripts (concurrent),
writes both archive.tar and archive.diff.tar.
Flags (presented in the same order as stan run --help):
-s, --scripts [keys...]
Select specific script keys. If provided with keys, runs them (order preserved with -q). If provided without keys, selects all known scripts.
When -s is omitted, the default selection comes from config (see “Config‑driven defaults”).
-S, --no-scripts
Do not run scripts. This conflicts with -s and -x.
If combined with -A as well, STAN prints the plan and does nothing else.
-x, --except-scripts <keys...>
Exclude these keys. If -s is present, reduces the -s selection; otherwise reduces from the full set of known scripts.
-m, --prompt
System prompt source: auto (default), local, core, or a file <path>.
auto: prefer a local prompt at <stanPath>/system/stan.system.md; fall back to the packaged core prompt.
core: use the packaged baseline from @karmaniverous/stan-core.
<path>: use the specified file (absolute or repo‑relative).
Diffs suppress stan.system.md in steady state for core/<path> sources (the full archive always contains the prompt for the run). When the effective prompt changes since the last stan snap, it appears exactly once in archive.diff.tar.
-q, --sequential / -Q, --no-sequential
Run sequentially (preserves -s order) or concurrently (default).
Facet overlay (selection view; defaults via stan-cli.cliDefaults.run.facets)
-f, --facets
Enable facet overlay for this run.
-F, --no-facets
Disable facet overlay for this run.
--facets-on <names...>
Force named facets active for this run (does not persist to facet.state.json).
--facets-off <names...>
Force named facets inactive for this run (does not persist; explicit off wins).
Plan view:
The run plan prints a “facet view” section (overlay on/off, inactive facets, auto‑suspended facets, anchors kept count).
Notes:
-f, --facets enables the overlay only; it does not “activate all facets”. Per-facet activation still comes from <stanPath>/system/facet.state.json plus any --facets-on/--facets-off overrides.
Leaf-glob facet excludes (e.g., **/*.test.ts) are deny-list filters only; they are not implemented via anchors and must not cause matching files to appear inside structurally inactive subtrees.
Include .stan/output inside archives and remove outputs from disk (combine mode).
Conflicts with -A (cannot combine while disabling archives).
-k, --keep / -K, --no-keep
Keep (do not clear) the output directory across runs.
-p, --plan
Print a concise run plan and exit with no side effects.
-P, --no-plan
Execute without printing the plan first.
Plan header contents:
The plan includes a prompt: line that reflects the resolved system prompt source for the run (for example, auto → local (.stan/system/stan.system.md) or @karmaniverous/stan-core@<version> when --prompt core is used).
This mirrors the effective prompt used during archiving and helps keep logs self‑describing.
-l, --live / -L, --no-live
Enable/disable a live progress table in TTY. Built‑in default: enabled.
Non‑TTY runs (tests/CI) are unaffected and keep line‑per‑event logs.
--hang-warn
Label a running script as “stalled” after this many seconds of inactivity (TTY only).
--hang-kill
Terminate stalled scripts after this many seconds (SIGTERM → grace → SIGKILL; TTY only).
--hang-kill-grace
Grace period in seconds before SIGKILL after SIGTERM (TTY only).
Defaults (built‑in unless overridden by cliDefaults or flags):
hang-warn 120s
hang-kill 300s
hang-kill-grace 10s
Live UI status legend (TTY)
waiting: grey
run: blue
quiet: cyan
stalled: magenta
timeout: red
ok: green
error: red
cancelled: black
Notes:
In BORING mode (or non‑TTY), statuses render as bracketed tokens (e.g., [WAIT], [RUN], [QUIET], [STALLED], [TIMEOUT], [OK], [FAIL], [CANCELLED]) without color.
No‑live parity: with --no-live and thresholds set, STAN logs concise inactivity events (“stalled/timeout/killed”) and preserves artifact parity with live runs (archives skipped on user cancel; outputs/archives otherwise identical given the same inputs and flags).
Live mode suppresses legacy “stan: start/done …” archive lines; progress is rendered in the live table. In no‑live mode, those lines are printed as concise console logs.
Conflicts and special cases:
-c conflicts with -A (combine implies archives).
-S conflicts with -s and -x.
-S plus -A (scripts disabled and archives disabled) => “nothing to do; plan only”.
Patches must be plain unified diffs (git‑style headers) with LF line endings. STAN cleans and saves the diff to .stan/patch/.patch, then applies it safely (or validates with --check). On failure, it writes diagnostics and a FEEDBACK packet and (when possible) copies it to your clipboard.
Sources and precedence:
[input] argument → highest precedence (treat as patch text).
-f, --file [filename] → read from file; if -f is present without a filename, read from clipboard.
Retention is bounded by maxUndos (default 10; configurable).
Init — options
stan init scans your package.json, lets you pick scripts, writes stan.config.yml, ensures workspace folders and .gitignore entries, and writes docs metadata under .stan/system/.
Options:
-f, --force
Create stan.config.yml with defaults (non‑interactive). Defaults: stanPath=.stan, empty includes/excludes, no scripts unless preserved.
--preserve-scripts
Keep existing scripts from an older stan.config.* when present.
Otherwise you’ll be prompted to select scripts from package.json.
Config‑driven defaults (stan-cli.cliDefaults)
Phase‑scoped defaults are read from your config when flags are omitted. Precedence: flags > stan-cli.cliDefaults > built‑ins.