On this page · 8 sections
The help text documents no flag for JSON output. An agent that wants the result as data has to read text that was laid out for human eyes, which breaks when the layout changes.
What it checks
ax-check reads the output of the help probe (--help, falling back to -h, and to help with --probe help-word). The rule fires when the help text mentions none of: --json, --format json, --format=json, --output json, -o json, --jsonl, --ndjson or --porcelain, and no documented flag offers json as a choice. If no help probe works, this rule does not run, and Help is not reachable reports the missing help instead.
Why it matters
Tables, colours and aligned columns are for people. A script or an agent needs fields it can address by name. The Command Line Interface Guidelines say: “Display output as formatted JSON if –json is passed.” Cloudflare’s documentation for its cf CLI says that its output contract puts the result on stdout as JSON (vendor documentation).
Missing machine output is also a documented pain point. cloudflare/cf issue #105 is titled “Output for scripts and agents: empty stdout with exit 0, –version not machine-readable, agent detection changes nothing”. The --version part was later fixed. The issue is context, not a measurement of how common the problem is.
How to fix
Add --json (or --format json) and list it in --help. With the flag, write only JSON to stdout and send all other messages to stderr. See Documented JSON output does not parse, which checks that the JSON really parses.
Example
Before
$ invoicer list --help
Usage: invoicer list [options]
Options:
--status <s> Filter by status
--limit <n> Maximum rows
$ invoicer list
ID CUSTOMER TOTAL STATUS
1042 Acme Ltd 120.00 paid
1043 Brightside 80.50 open
After
$ invoicer list --help
Usage: invoicer list [options]
Options:
--status <s> Filter by status
--limit <n> Maximum rows
--json Print the result as JSON on stdout
$ invoicer list --json
[{"id":1042,"customer":"Acme Ltd","total":"120.00","status":"paid"},
{"id":1043,"customer":"Brightside","total":"80.50","status":"open"}]
A Node fix:
if (opts.json) {
process.stdout.write(JSON.stringify(rows) + '\n');
} else {
printTable(rows);
}
How ax-check detects it
This is a text search over the help output. It looks for the listed flag spellings anywhere in the text, including in prose. It does not check that the flag works. With --probe json, Documented JSON output does not parse checks that the output parses; without it, Advertised JSON output not verified reports that the output was not verified.
Known false positives: a CLI whose output is already machine-readable by default, for example one that always prints JSON, and a CLI that has no meaningful output. Known false negatives: help text that mentions --json in an unrelated sentence. Silence the rule with --disable <rule-id> when it does not apply.
To reproduce by hand: invoicer --help </dev/null | grep -Ei 'json|jsonl|ndjson|porcelain'.
Safety note: This rule reads help text only, from the default --help probe. probe-cli executes your program under your own OS account. The temporary working directory and HOME it uses are not a sandbox: the program can still read and write anything your account can, and use the network. Probe a CLI you have not reviewed only inside a container or a throwaway virtual machine. Run ax-check probe-cli --dry-run -- invoicer first to see the probes that would run, and see the “Probe safety” section of the ax-check README for what is and is not isolated.
Sources
- Guideline: Command Line Interface Guidelines, clig.dev. https://clig.dev/ . Says to display output as formatted JSON if
--jsonis passed. - Vendor documentation: Use cf with coding agents, Cloudflare, updated 2026-09-29. https://developers.cloudflare.com/cf/agents/ . Documents an output contract with the result on stdout as JSON.
- Vendor issue: cloudflare/cf issue #105, “Output for scripts and agents: empty stdout with exit 0, –version not machine-readable, agent detection changes nothing”. https://github.com/cloudflare/cf/issues/105 . Context only; the
--versionpart was later fixed.
Related evidence
Records in the AX evidence register about the same pattern as this rule. They don’t test the rule itself.
Coding agents mostly read instruction files, not docs sites
An observational study of 557 agentic coding sessions (preprint) found that instruction files and working notes made up 60.5% of agents' documentation interactions, against 10.6% for classical technical documentation and 1.3% for API references.
Preprint: not yet peer reviewed
Compact documentation did not help when the source was present
Across two model families and ten repositories, with a positive control, a preprint found that neither compact natural-language documentation nor retrieved context helped coding agents resolve issues better than the issue alone when the source code was present.
Preprint: not yet peer reviewed
A capable agent skipped the index and guessed the page
A preregistered ablation on a 709-page Markdown wiki (preprint) found that a capable tool-using agent never loaded the compact catalogue index, inferring page paths from the question instead, while retrieval-based access kept answer quality non-inferior and cut cost by about a third to over half.
Preprint: not yet peer reviewed
A warning that names the failing plan redirected agents; a tip did not
Microsoft reports that a documentation tip pointing to the right tool got 1 of 5 agent runs to use it, while a warning naming the agent's failing approach ('Manually updating package.json alone will result in build failures') got 5 of 5.
Vendor measurement: the vendor’s own, with its method
Adding the context7 MCP server gave no lift; its tools went unused
Microsoft reports that adding the context7 MCP server to an anti-hallucination skill gave no meaningful lift on an SPFx upgrade: its tools did not load in 3 of 5 runs and were not called in the other 2, while telling the agent to use CLI for Microsoft 365 raised configuration correctness from 30/80 to 75/80.
Vendor measurement: the vendor’s own, with its method
Vendor claim: agents never invoked a docs skill in 56% of eval cases
Vercel states that in its Next.js 16 evals the docs skill was never invoked in 56% of cases, so the skill matched the 53% pass rate of no docs, while an 8KB docs index in AGENTS.md reached 100%.
Vendor claim: a figure with no published method
Related guides
Agent error recovery: design the path back
Agent error recovery in practice: what a failure response must say, when a retry is safe, how to handle partial completion, and when to escalate.
Guide
Write agent-readable documentation
Agent-readable documentation in practice: what documentation for AI agents must answer, how to shape a page around one decision, and how to keep it true.
Guide
