Global options in the Cratis CLI
Every cratis command accepts the following options regardless of which subcommand you run.
—output / -o
Section titled “—output / -o”Controls the format of command output.
cratis <command> -o <FORMAT>| Value | Description |
|---|---|
table |
Rich terminal table with borders and color. Default in interactive terminals. |
plain |
Tab-separated rows, no decoration. Suitable for shell scripting and parsing. |
json |
Pretty-printed JSON with indentation. |
json-compact |
Compact single-line JSON. May be selected by a recognized tool-environment marker. |
In interactive terminals the default is table. Redirected output, NO_COLOR, and recognized tool-environment markers can select another current default. Use --output explicitly for automation and bind parsing to the exact CLI version; ordinary output formats are not an unversioned stable machine contract.
Example:
cratis chronicle event-types list -o plain—quiet / -q
Section titled “—quiet / -q”For lists using the shared formatter, outputs the selected identifier for each result, one per line, with no headers or decoration. With an explicit --output json or --output json-compact, it instead produces a compact JSON array of identifiers.
Quiet behavior is command-specific: other commands may suppress output, print a file path, or retain a result object in JSON mode. Check the target command’s reference.
cratis chronicle observers list -qThis mode prints identifiers for bounded selection or inspection:
cratis chronicle observers list -q | head -n 5Review the target command, event store, namespace, and operational procedure before using an identifier as input to a state-changing command.
—yes / -y
Section titled “—yes / -y”Skips confirmation prompts on state-changing commands such as replay, retry, and remove.
cratis chronicle observers replay <ID> -yState-changing commands do not proceed in automation, redirected output, or other non-interactive environments unless this flag is supplied. Use it only when the exact target, authorization, current state, and recovery procedure are already bounded; the prompt exists to prevent accidental changes.
Set CRATIS_NONINTERACTIVE=1 when an automation host uses a terminal-like input/output stream but must never be prompted:
CRATIS_NONINTERACTIVE=1 cratis chronicle observers replay <ID> -yWithout --yes, the command fails with a nonzero validation exit code.
cratis llm-context marks every command that asks for confirmation with "requiresConfirmation": true, next to its effect. See LLM Context.
—debug
Section titled “—debug”Prints diagnostic information to stderr before executing the command. No server output is affected.
The debug panel includes:
- Config file path
- Active context name
- Connection string (credentials are redacted)
- Resolved output format
- Resolved event store and namespace, each with the source it came from (option, context, or built-in default)
- RPC timing for each gRPC call
cratis chronicle observers list --debugThis flag is useful for diagnosing connection problems, verifying which context is active, and measuring server response times.
—environment
Section titled “—environment”Selects the project environment (.cratis/environments/<name>.yaml) for commands that read environment configuration. It overrides the CRATIS_ENVIRONMENT environment variable and the selection made with cratis env select; when none of them is set, the environment is development.
cratis config list --environment productionSee Selecting an environment for the full order of precedence.
NO_COLOR Environment Variable
Section titled “NO_COLOR Environment Variable”Setting NO_COLOR to a nonempty value selects plain output during automatic format selection, unless a recognized AI environment has already selected json-compact. An explicit --output takes precedence over NO_COLOR:
NO_COLOR=1 cratis chronicle event-types listThis follows the no-color.org convention. An empty value does not change format selection.
Update hints and CRATIS_NO_UPDATE_CHECK
Section titled “Update hints and CRATIS_NO_UPDATE_CHECK”After a command finishes in an interactive terminal, the CLI may print a one-line hint:
↑ Update available: <current> -> <latest>when a newer CLI is published where this installation updates from (NuGet for the dotnet tool, the GitHub releases for native installations).↑ Stage image update available: <version>when a Stage image is already on this computer and a newer one exists.↑ Builder image update available: cratis/builder 1.5.0 - run 'cratis update'when a packaged builder image is already on this computer and Docker Hub has a newer version, one line per image.↑ Cratis AI update available: <n> new commits since <installed> - run 'cratis ai update'when the current directory has Cratis AI installed and the default branch of Cratis/AI has moved past the installed commit.
The checks run in the background while the command runs. Once it is done, the CLI waits a fraction of a second in total for all of them, and a check that has not answered by then shows nothing this time.
Answers are cached in ~/.cratis/version-check.json. A cached answer less than an hour old is used without asking again. After that the source is asked again: if it is slow, an update found within the last day is shown meanwhile, and the new answer is recorded if it arrives before the CLI exits. A failed request is not repeated for 15 minutes, or for an hour when GitHub reports its rate limit as spent. No hint is printed for shell completion, redirected output, or a detected AI agent environment.
The cache file is shared by every cratis process without a lock. Two processes that finish at the same moment can lose one of their cache entries, and on Windows an update that fails because another process holds the file open is dropped the same way. Either only costs one extra request on a later run.
Set CRATIS_NO_UPDATE_CHECK to any value to switch all of these checks off, including the local Docker lookups behind the Stage image and builder image hints:
CRATIS_NO_UPDATE_CHECK=1 cratis chronicle event-types list