Repository navigation
feat: add labels command to list workspace labels - #43
Closed
seraph-pixelperfect wants to merge 1 commit into
Closed
seraph-pixelperfect wants to merge 1 commit into
seraph-pixelperfect wants to merge 1 commit into
Conversation
`linear-axi labels` lists the workspace's issue labels through the root
`issueLabels` connection (the same connection resolveLabelIds already
queried workspace-wide), auto-paginated in 50-node batches with
orderBy: updatedAt (recent-first, matching issues/projects/cycles).
TOON rows render the label name and its color as the raw HEX string
("#EB5757"-style per the generated IssueLabel type in @linear/sdk —
rendered raw since terminal color support varies, no ANSI swatch), with
a count line, definitive empty state, and hints pointing at
`issue create --label` and `issues --label`.
resolveLabelIds now reuses fetchLabels, fixing a latent gap where label
resolution fetched a single unpaginated page and silently missed labels
beyond the first 50; matching stays case-insensitive in server order.
Closes #22
This was referenced Aug 19, 2026
Collaborator
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.
Closes #22. Depends on #42.
What
linear-axi labelslists the workspace's issue labels through the rootissueLabelsconnection — the same connectionresolveLabelIdsalready queried workspace-wide — as TOON rows ofname+color(raw HEX), with a count line, a definitive empty state, and hints pointing atissue create --labelandissues --label. Last v0.2 item.Stacked PR note
Stacked on #42 (stack: #37 → #38 → #39 → #40 → #41 → #42). Base is
feat/comment-list, not main.No CI checks appear on this PR —
ci.ymlonly triggers on PRs targetingmain. CI runs when retargeted tomainafter the stack merges; local gates below are the evidence.Schema source
Fields verified against the generated documents in
@linear/sdkv90.0.0 (npm pack @linear/sdk, inspectingdist/*.d.mts/dist/index.mjs), same method as the parent PRs:IssueLabel(dist/index-zxW4m1xd.d.mts, line 10324):color: String— "The label's color as a HEX string (e.g., '#EB5757')" — non-nullable;name: String; a render-friendlydescription?: Maybe<String>also exists (see Ambiguities);team?: Maybe<Team>distinguishes team-scoped from workspace-level labels.QueryIssueLabelsArgs: the rootissueLabelsconnection takesafter/filter/first/includeArchived/last/orderBy: PaginationOrderBy— full cursor pagination, same shape asprojects/cycles/comments.PaginationOrderBy(dist/index.mjs, line 3539): onlycreatedAt|updatedAt— soorderBy: updatedAtis the recent-first ordering, consistent with issues/projects/cycles (no name sort exists).Implementation
fetchLabels(apiKey, limit = 500)insrc/linear.tsfollows the established auto-pagination pattern (fetchProjects/fetchComments):pageInfo { hasNextPage endCursor }, 50/batch, same non-advancing-cursor/empty-page loop guards,hasMorein the result.src/commands/labels.tsfollows theprojects/cyclestemplate:LABELS_HELPconst, no flags (unknown-flag rejection), count line,renderList, hints.resolveLabelIdsnow reusesfetchLabelsinternally — deduplicated query string, and it fixes a latent gap where label resolution fetched a single unpaginated page and silently missed labels beyond the first 50. Matching stays case-insensitive in server order; no existing test asserted on the old document.src/cli.ts(commands map,COMMAND_HELP,TOP_HELPnowcommands[9]with alinear-axi labelsexample) andsrc/skill.ts;skills/linear-axi/SKILL.mdregenerated viapnpm run build:skill.Demo (real output)
Before (base c6221ac):
After — stubbed-fetch render (no network):
After —
labels --key lin_api_fakereaches the Linear API layer (real request to api.linear.app; the fake key is rejected 401 and mapped bysrc/errors.ts):Top help:
Local gates (real output)
pnpm build—$ tsc, clean.pnpm lint—$ eslint ., clean.pnpm run build:skill -- --check—skills/linear-axi/SKILL.md is up to date.pnpm test:(baseline on base branch: 124 tests in 12 files; +10 new in
test/labels.test.ts: document shape incl. color + pagination args, name/color row rendering, truncation count line, empty workspace, two-page cursor-advanced pagination, unknown-flag rejection, hints, create-path label resolution through the reused query, help)pnpm run format:check— RED pre-existing: the same 18 files asmain(CI does not run it). New/edited-by-me files passpnpm exec prettier --check(src/commands/labels.ts,test/labels.test.tsclean;src/linear.ts/src/cli.tswere already in the pre-existing flagged set and prettier's normalized delta on them is exactly this PR's additions).CI quota caveat
If CI checks later appear and fail: GitHub Actions billing/spending-limit rejections look like check failures. Check
gh run view <run-id>/ the jobs API for a billing annotation, or an emptystepslist with a ~3-4s duration. If quota-blocked, this PR relies on the local gate output above; it will not be retried against the quota.Ambiguities flagged
#EB5757). No truecolor/ANSI swatch attempted — terminal color support varies (per task guidance).IssueLabel.coloris a non-nullable String per the SDK.IssueLabel.description(nullable String) exists and is render-friendly, but the issue spec says "name, color where exposed", so it is not selected/rendered. Easy follow-up column if wanted.orderBy: updatedAt(recent-first) for consistency with issues/projects/cycles;PaginationOrderByoffers no name sort, so no alphabetical ordering is possible server-side.resolveLabelIdsrefactor: done — it reusesfetchLabels, preserving case-insensitive matching and server-order ids while fixing the >50-labels resolution gap; covered by a new create-path test. Reverted easily if reviewers prefer the old minimal query.fetchLabelsdefaults to 500 (10 pages) — generous for real workspaces while guarding a runaway cursor;hasMoresurfaces ascount: N (showing first N)when hit.Identity note
Automated agent dispatch authenticated as
seraph-pixelperfect; this PR is submitted for human review — not self-approved. Merge is a human decision.