Skip to main content

CLI OUTPUT

The Swamp CLI supports two output modes: log-mode (the default) and JSON mode.

Log-mode (default)

Human-readable, coloured terminal output. This is the default when no output mode override is set.

JSON mode

Structured JSON output, one object per line. Enable it with either:

  • The --json flag on any command.
  • The SWAMP_CLI_OUTPUT_JSON environment variable, which sets JSON as the persistent default.

SWAMP_CLI_OUTPUT_JSON

Value Effect
Unset, empty, 0, or false Log-mode (no effect)
Any other non-empty value (e.g., 1) JSON output by default

The --json flag on an individual command also enables JSON output regardless of the environment variable.

export SWAMP_CLI_OUTPUT_JSON=1
swamp model list          # JSON output
swamp workflow run deploy  # JSON output

--log is not an output mode

The --log flag controls model and workflow run-log visibility — whether execution logs appear in terminal output. It does not select the output format. --log and --json can be combined: --json sets the format, --log adds run-log entries to it.

See also