Skip to content

Stop presenting linear api's positional as a subcommand in help - #288

Merged
schpetbot merged 1 commit into
mainfrom
schpet/push-uyoymyqtkxuw
Sep 15, 2026
Merged

schpetbot merged 1 commit into
mainfrom
schpet/push-uyoymyqtkxuw

Conversation

@schpetbot

Copy link
Copy Markdown
Collaborator

linear --help listed api [query] and linear api --help said Usage: linear api [query], styled like the real subcommands, so linear api query '<document>' read as the natural invocation and then failed with a misleading "Too many arguments: ".

This is a help-text and docs fix only. Parsing, options, exit codes and output are unchanged (linear api query '...' still exits 2 with the same error, and the added tests pin that).

  • The positional is labelled [graphqlDocument] in both linear --help and linear api --help. camelCase matches every other multiword positional (issueId, urlOrIssueId) and, unlike a kebab-case label, cannot be mistaken for one of the kebab-case subcommands.
  • The description now says the document is the only argument, passed quoted or on stdin, and that api has no subcommands. cliffy prints the command help right above the "Too many arguments" error, so the mistaken invocation now explains itself.
  • An Examples: section covers inline, named query with --variable, stdin pipe, - with a file, and --paginate. Each example was run as written against a mock GraphQL server.
  • The skill template carries the same note; SKILL.md and references/api.md are regenerated with deno task generate-skill-docs (idempotent).
  • Tests: a snapshot of the mistaken invocation, plus subprocess tests asserting the root help row and the exit code.

Deliberately not done: rejecting unknown subcommands so linear api query --help stops exiting 0. That is cliffy's generic --help precedence (linear issue view FOO --help behaves the same), and changing it would be a behaviour change.

Fixes #286

https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub

`linear --help` listed `api  [query]` and `linear api --help` said
`Usage: linear api [query]`, styled exactly like the real subcommands,
so `linear api query '<document>'` read as the natural invocation. It
fails with "Too many arguments: <document>", which looks like the query
was parsed and rejected, and `query` is a genuine subcommand elsewhere
(`issue query`).

This is a help-text fix only; parsing, options, exit codes, and output
are unchanged. The positional is now labelled `[graphqlDocument]`
(camelCase like every other multiword positional, and unlike the
kebab-case subcommands it was being mistaken for), the description says
the document is the only argument and that api has no subcommands, and
an Examples section covers the inline, named-query-with-variables,
stdin, file, and --paginate forms. Because cliffy prints the command
help above the "Too many arguments" error, the mistaken invocation now
explains itself. The skill template carries the same note and the
generated skill docs are regenerated.

The reporter also suggested rejecting unknown subcommands so that
`linear api query --help` stops exiting 0 with api's help. That is
cliffy's generic --help precedence (`linear issue view FOO --help`
behaves the same) and changing it would alter behaviour, so it is
deliberately left alone.

Github-Issue: Fixes #286
Github-Issue-Url: #286

Claude-Session: https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub
@schpetbot
schpetbot merged commit 6ac736c into main Sep 15, 2026
15 checks passed
@schpetbot
schpetbot deleted the schpet/push-uyoymyqtkxuw branch September 15, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api [query]: the positional name reads as a subcommand, and linear api query --help exits 0 with api's help

2 participants