Add --json to team list, cycle list/view, milestone list/view, project view - #277
Merged
Conversation
…t view
Scripts need to map a team name to its key and id, and team list was the
only way to see both, so they had to scrape its table. It was also the last
list command without JSON. The maintainer asked to sweep the other commands
in the same state; the survey found cycle list, cycle view, milestone list,
milestone view, and project view, so all six get -j, --json here. issue mine
stays human-only on purpose (issue query is its JSON surface).
The reporter proposed a five-field subset for team list. The JSON instead
carries every field the query already selects, per the repository rule to
preserve GraphQL names and nesting rather than invent CLI shapes. Lists emit
{ nodes, pageInfo } after the same filtering and ordering as the table, so
archived teams stay hidden and cycles stay newest-first. Views emit the
object as fetched, including every issue rather than the ten-item preview,
and milestone view --all --json includes every page.
Two of these queries took Linear's default page with no cursor: cycle list
and milestone list silently dropped everything past fifty. Adding JSON would
have made that easier to consume without making it safer, so both now
paginate and fail loudly if Linear advertises a page without a cursor. The
view queries gain pageInfo on their issues connection so callers can see
when a page was partial. A 2.0.0 changelog entry claimed cycle list --json;
that merge only touched SVG files, so this is the first time it ships.
Github-Issue: Fixes #276
Github-Issue-Url: #276
Claude-Session: https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
-j, --jsonto the six read commands that still lacked machine-readable output:team list,cycle list,cycle view,milestone list,milestone view, andproject view.team listwas the motivating case (the only place to map a team name to its key and id, and previously table-only); the other five came out of the sweep you asked for in #276.{ nodes, pageInfo }after the same filtering and ordering as the table (archived teams hidden, cycles newest-first, milestones by target date with undated last).milestone view --all --jsonincludes every page.cycle listandmilestone listwere taking Linear's default page with no cursor, silently dropping everything past 50. Adding JSON would have made that easier to consume without making it safer, so both now paginate (and fail loudly if Linear advertises a page without a cursor).cycle viewandproject viewgainpageInfoon their issues connection so callers can see when a page was partial.issue mineis deliberately untouched;issue queryis its JSON surface.cycle list --jsonnever actually landed (that merge only touched SVGs).Fixes #276
https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub