Machine-readable output format
Why it matters
A CLI without --json output is a CLI that cannot be scripted. Users pipe your tool into jq, feed it into CI, wrap it in Makefile recipes, and compose it with other tools — and all of that requires structured, decoration-free output on stdout. When mytool list prints a pretty table with emoji dividers, the user has to write a regex parser in bash to extract one field. They will not. They will switch tools. Mixing status messages into JSON output (Loading...\n{...}) is worse — it silently breaks | jq without any error.
Severity rationale
High because missing machine-readable output blocks CI, automation, and composition with Unix pipelines.
Remediation
Add a --json flag to every command that produces data, write JSON to stdout with no prefix or decoration, and route status/progress to stderr. Example in src/cli/commands/list.ts:
if (opts.json) {
process.stdout.write(JSON.stringify(items) + '\n')
} else {
console.log(formatTable(items))
}
Confirm with mytool list --json | jq ..
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the CLI Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from cli-quality·automated