Problem
All errors currently exit with code 1, including usage errors like missing required flags. This makes it harder for agents to distinguish between "I called the command wrong" and "something failed at runtime".
$ hccli datasets # missing --api-key
# exit: 1
$ hccli datasets --api-key bad-key # API auth failure
# exit: 1
Fix
Follow the standard convention:
- Exit 0: success (including no-ops)
- Exit 1: runtime error (API failure, resource not found, network error)
- Exit 2: usage error (missing required flag, unknown subcommand, bad argument)
urfave/cli v3 supports cli.Exit(msg, code) for setting exit codes explicitly.
Reference
AXI Principle 6 — Structured errors & exit codes
Problem
All errors currently exit with code 1, including usage errors like missing required flags. This makes it harder for agents to distinguish between "I called the command wrong" and "something failed at runtime".
Fix
Follow the standard convention:
urfave/cli v3 supports
cli.Exit(msg, code)for setting exit codes explicitly.Reference
AXI Principle 6 — Structured errors & exit codes