Chaque commande avec --help et des exemples, codes de sortie documentés, sûr dans les pipes.
Constitution — Go CLI
Version 1.0.0 · Ratified 2026-11-10
These principles hold for every spec, plan and task of the tool. A spec may add rules; it never weakens these.
-
Every command has help and examples. Every Cobra command sets
Short,LongandExample, and every flag has a description. A test walks the command tree and fails when a command has no example. -
Documented exit codes. Exit code 0 means success, 1 a general failure, 2 a usage error, and any other code is listed in the documentation with its meaning. Commands return errors from
RunE; onlymaincallsos.Exit. -
Safe in pipes. Results go to stdout and messages, progress and errors to stderr. Colour and spinners are off when stdout is not a terminal or
NO_COLORis set, and--output jsongives stable, documented fields. -
Predictable flags and config. Flags override environment variables, which override the config file, in that order for every setting. Names are consistent across commands, and destructive commands ask for confirmation unless
--yesis passed. -
Single static binary. Releases are static binaries built with GoReleaser for every supported OS and architecture, with checksums and signatures.
versionprints the version, commit and build date. -
Tested from the outside. Commands are tested by running them with arguments and asserting on stdout, stderr and the exit code, using golden files for output. Shell completions and docs are generated from the command tree in CI.