ax-check rule
AXC-C006: No machine-readable output flag
Help documents no --json, --format json or similar flag, so an agent must parse text meant for people.
ax-check is a checker being prepared for release. This page documents the rule ahead of that release; see all 50 rules.
| Severity | warn |
| Kind | Heuristic. A pattern match: a prompt to look, not a verdict. |
| Mode | ax-check probe-cli |
| Applies to | Command-line programs, run as a subprocess |
| Pattern tags | non-interactive, docs-for-agents |
| Fix in one line | Add --json (or --format json) and document it in --help. |
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 AXC-C009 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 AXC-C007, 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, AXC-C007 checks that the output parses; without it, AXC-C013 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 AXC-C006 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 that share a pattern tag with this rule. A shared tag means the record is about the same pattern, not that it tests this rule. Read the evidence class before the number.
- EV-0011: Coding agents mostly read instruction files, not docs sites (Preprint). 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.
- EV-0012: Compact documentation did not help when the source was present (Preprint). 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.
- EV-0027: A capable agent skipped the index and guessed the page (Preprint). 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.
- EV-0029: A warning that names the failing plan redirected agents; a tip did not (Vendor measurement). 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.
- EV-0030: Adding the context7 MCP server gave no lift; its tools went unused (Vendor measurement). 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.
- EV-0032: Vendor claim: agents never invoked a docs skill in 56% of eval cases (Vendor claim). 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%.
