This guide keeps Stave CLI output consistent, readable, and automation-friendly.
- Prefer explicit flags over ambiguous positional arguments.
- Keep command/flag names in kebab-case.
- Preserve script-safe behavior:
- machine output on stdout
- messaging/errors on stderr
- Use stable exit codes from
internal/cli/ui. - Never require prompts for normal operation.
- Reserve
-v/--verbosefor verbosity and use--versionfor version display. - Use lowercase, concise descriptions for commands/flags and avoid trailing periods.
- Prefer explicit flags over multiple positional args for clarity and ordering flexibility.
Each public command help should include:
- Purpose
- Inputs
- Outputs
- Exit codes
- Examples (most common first)
Recommended example order:
- basic local usage
- automation/CI usage
- troubleshooting/fix usage
- Prompts are optional only. Every prompted value must have a non-interactive flag/arg bypass.
- Do not require users to
cdto a directory when a path flag is practical. - Keep recurring flags consistent across commands:
--controls/-i--observations/-o--format/-fwhen applicable--forcefor destructive overwrite behavior--dry-runfor side-effect commands
- Human-first defaults are acceptable, but machine-readable output must be available where useful.
- Prefer one stable convention per command family (
--format text|jsonor equivalent). - Human-readable output should remain grep-friendly.
- JSON output should remain stable for automation and jq-based pipelines.
For text-mode output, prefer this section order:
Summary- Key details/findings/diagnostics
Next step
Next step should provide one actionable command.
Use structured errors in both JSON and text paths with:
- error code
- short title
- description
- fix/action
- URL for more information
Stack traces must not be shown by default. Detailed debugging output is enabled via verbosity flags.
- Keep text output plain and grepable.
- Use progress updates only when stderr is a TTY.
- Respect
NO_COLORand--no-color.
- Help includes purpose, inputs, outputs, exit codes, examples.
- Uses consistent recurring flags and aliases where applicable.
- Supports non-interactive usage (no required prompt).
- Keeps stdout/stderr separation.
- Provides machine-readable output when command output is consumed by tooling.
- Adds
--dry-runif command writes/modifies files or generates artifacts.