Half your users don't have eyes
Description and use
CLI tools often emit only human‑readable text, breaking scripts and CI. By adding a --output json flag and wrapping results in a stable JSON envelope, programs get a reliable contract while human output can be freely improved.
Problem
CLI tools often output only human‑readable text, breaking scripts, CI pipelines, and automation that rely on parsing that output.
Outcome
Automated consumers no longer break when human output changes; scripts can reliably check status and extract data. Human output becomes more readable and maintainable.
Workflow
- 1. Add a
--outputflag to every command using the framework. - 2. When
--output jsonis requested, serialize the command result into aResponseenvelope. - 3. Scripts and CI jobs call the command with
--output jsonand parse the JSON payload. - 4. Human users run the command without the flag to see the friendly text.
- 5. Maintain the envelope shape across all commands to keep the contract stable.
Evidence
The consumer-side payoff is the whole point. A script can check .status without ever touching .data.
Machines get a stable, explicit, learn-it-once contract; humans get output that's now free to be properly readable.
- Record date: 2026-09-20T11:15:23.153Z