Describe the feature or problem you'd like to solve
gh issue list (and gh pr list, gh run list, etc.) print a nice default table: number, title, labels, state, updated-at. But the moment you want JSON — the 90% case for scripting — --json requires you to enumerate every field:
$ gh issue list --repo cli/cli --json
Specify one or more comma-separated fields for `--json`:
assignees author blockedBy blocking body closed closedAt ...
That's ~25 fields to pick from every time. Every script or agent ends up hardcoding something like --json number,title,state,labels,updatedAt — which is fragile (typos), verbose, and inconsistent across scripts.
Proposed solution
Add a --json-default shortcut (or accept --json with no argument, or --json=default) that emits the same columns the default table shows:
$ gh issue list --repo cli/cli --json-default
[{"number": 13764, "title": "...", "state": "OPEN", "labels": [...], "updatedAt": "..."}]
Value:
- Matches the mental model of "give me the table, but as JSON."
- Stable for scripts that don't care about specific fields, just want to iterate over the list they'd otherwise see on-screen.
- Discoverable —
--help can document the default set per command.
Alternative shape: --json without arguments prints the default columns instead of erroring (arguably a small backwards-compat break, but the current error path is a UX cliff).
Additional context
Distinct from #10385 (which is scoped to gh search prs implying --json when --jq is used). This is about the default column set being reachable in JSON mode across all ... list commands.
Related: #8890 (hyperlinks/headers in gh pr list), #9152 (piped-output edge cases).
Not asking for auto-detection or magic — just a named shortcut for the columns the tool already knows are the sensible defaults.
Describe the feature or problem you'd like to solve
gh issue list(andgh pr list,gh run list, etc.) print a nice default table: number, title, labels, state, updated-at. But the moment you want JSON — the 90% case for scripting —--jsonrequires you to enumerate every field:That's ~25 fields to pick from every time. Every script or agent ends up hardcoding something like
--json number,title,state,labels,updatedAt— which is fragile (typos), verbose, and inconsistent across scripts.Proposed solution
Add a
--json-defaultshortcut (or accept--jsonwith no argument, or--json=default) that emits the same columns the default table shows:Value:
--helpcan document the default set per command.Alternative shape:
--jsonwithout arguments prints the default columns instead of erroring (arguably a small backwards-compat break, but the current error path is a UX cliff).Additional context
Distinct from #10385 (which is scoped to
gh search prsimplying--jsonwhen--jqis used). This is about the default column set being reachable in JSON mode across all... listcommands.Related: #8890 (hyperlinks/headers in
gh pr list), #9152 (piped-output edge cases).Not asking for auto-detection or magic — just a named shortcut for the columns the tool already knows are the sensible defaults.