Skip to main content

Global flags and environment variables

These settings are shared across the CLI.

Global flags

FlagTypeDefaultEnvironment variableDescription
--log-levelstringderivedWHZBOX_LOG_LEVELAbsolute log level. Accepted values: debug, info, warn, warning, error.
-v, --verbosecount0WHZBOX_VERBOSEIncreases verbosity. -vv enables debug logging.
-q, --quietbooleanfalseWHZBOX_QUIETSuppresses non-error log output.
--no-colorbooleanfalseWHZBOX_NO_COLOR or NO_COLORDisables ANSI color output.
--yesbooleanfalseWHZBOX_YESSkips confirmation prompts.
--jsonbooleanfalseWHZBOX_JSONRequests machine-readable JSON. Only create and list implement JSON output.

Environment variables without matching flags

VariableDescription
WHZBOX_STATE_DIROverrides the state directory used for state.json.
WHZBOX_WHIZLABS_BASE_URLOverrides the main Whizlabs API base URL. Intended for tests or local development.
WHZBOX_WHIZLABS_PLAY_URLOverrides the Whizlabs play API base URL. Intended for tests or local development.

Configuration precedence

Shared configuration is loaded in this order:

  1. command-line flags
  2. environment variables
  3. built-in defaults

Logging precedence

After configuration is loaded, logging resolves in this order:

  1. --log-level or WHZBOX_LOG_LEVEL
  2. -v or WHZBOX_VERBOSE
  3. -q or WHZBOX_QUIET
  4. default info

Notes

  • There is no --state-dir flag. Use WHZBOX_STATE_DIR.
  • NO_COLOR is honored even without --no-color.

See also