ghidra-cli/docs/adr/0003-default-to-json-everywhere.md
hermes 5c81b469e5
Some checks failed
checks / flake (push) Has been cancelled
fix: make help and version successful discovery
2026-07-29 04:15:53 +00:00

999 B

status
accepted

Default to JSON everywhere

Automation agents are the primary consumers, so the shortest invocation must produce the stable machine interface. The CLI defaults to JSON regardless of whether stdout is a terminal or pipe; human-readable presentation requires --format human. Avoiding TTY-dependent format selection ensures that the same command has the same framing and semantics in every execution environment. JSON mode never emits interactive prompts; required confirmation is represented as a structured error and satisfied by an explicit flag.

Clap discovery requests are intentionally outside the operation-result protocol. Root and subcommand --help, plus --version, return conventional plain UTF-8 text on stdout with status 0 and no stderr. They do not initialize the runtime or execute an operation. This narrow exception keeps the CLI self-describing for both people and automation agents without weakening JSON framing for analysis and cleanup commands.