CLI design checklist
Help and version
- A CLI MUST provide
--helpand-hflags with clear usage, options, and examples. Examples MUST include all required parameters. - A CLI MUST provide
--versionand-Vflags. The agent MUST reserve-vfor--verbose.
Input and output
- A CLI MUST support stdin/stdout piping and MUST allow output
redirection (e.g.,
--outputfor file creation). - A CLI emitting structured data MUST offer machine-readable
output (e.g.,
--json).
Safety and control
- A CLI that modifies or deletes data MUST provide
--dry-runand an explicit bypass flag (--yesor--force). - A CLI MUST provide controllable logging (
--quiet,--verbose, or--trace). - A CLI MUST use deterministic exit codes: 0 for success, non-zero for failure. The agent MUST NOT introduce silent fallbacks.
- A CLI MUST implement strictly non-interactive modes for CI/CD environments.
Configuration
- A CLI that consumes JSON configuration MUST define and update a JSON Schema and MUST validate configuration on load.
- A CLI MUST support configuration via environment variables for sensitive or environment-specific data.
Interactive prompts
- An interactive prompt MUST provide required context before asking. For yes/no prompts, Enter MUST mean "Yes" and "n" MUST mean "No".