Skip to content

Selective --json <fields> on read commands #1

Description

@andreiRS

What

Add field selection to --json on read commands: tasks list --json id,title,column returns only those fields, instead of the full object. Borrowed from gh issue's --json <fields> pattern.

Why

gh issue's real strength is one consistent machine-output contract across every read command, learned once. We already have --json everywhere, but it's all-or-nothing. Field selection is the highest-leverage, lowest-cost thing to copy: it helps agents most (smaller, targeted payloads) and matches gh's actual design win.

Scope

  • Applies to read commands that emit --json: show, list, board, next, export, summary.
  • --json with no field list keeps current behavior (full object). --json f1,f2 narrows.
  • Invalid field name → error envelope (new code, e.g. INVALID_FIELD) listing valid fields.
  • Out of scope: jq filtering (-q) and Go-template output (-t). Field selection only.

Notes

Captured from a design comparison against gh issue. See docs/gh-issue-inspiration.md for the full borrow/beat/don't-copy analysis. Parked for now: labels, search, close/reopen shortcut. This issue is the one agreed "do it" item; the rest stay deferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions