feat(cli): richer subcommand help with per-resource filters and input hints#19
feat(cli): richer subcommand help with per-resource filters and input hints#19
Conversation
…subcommand help Closes #7
There was a problem hiding this comment.
Pull request overview
This PR enhances CLI subcommand help output so resource commands (list, create, update) show scoped inherited global flags, include per-resource examples, and provide JSON input field hints (including a link to Linear’s schema.graphql). It also adds tests to prevent future drift between handler behavior and advertised help.
Changes:
- Add a new help-text generator for resource subcommands with per-resource filters/pagination/output sections, examples, and schema input hints.
- Wire the new help text into resource command registration (
list/create/update), and clarify--inputoption descriptions. - Add help output tests asserting scoped inherited globals and presence of examples/input hints.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/cli/tests/help.test.ts | Adds assertions that subcommand help includes scoped inherited globals, examples, and input-type/schema hints. |
| packages/cli/src/help/resource-help.ts | Introduces the per-resource help text catalog and formatting helpers for list/create/update subcommands. |
| packages/cli/src/commands/resource.ts | Integrates resource-specific help text into command registration and updates --input option descriptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type FilterFlag = | ||
| | "team" | ||
| | "mine" | ||
| | "project" | ||
| | "cycle" | ||
| | "state" | ||
| | "assignee" | ||
| | "label" | ||
| | "priority" | ||
| | "status" | ||
| | "filter" | ||
| | "sort"; |
| const OUTPUT_LINES: readonly string[] = [ | ||
| "--view <preset> Human output preset: table | detail | dense", | ||
| "--fields <list> Comma-separated field selection", | ||
| "--json Strict machine output", |
| } | ||
|
|
||
| function updateHelp(entity: string, help: UpdateHelp): string { | ||
| return `\nUpdate accepts any non-empty JSON payload.\n\nExamples:\n${joinExamples(help.examples)}\n\n${inputDocsHint(entity)}`; |
# [1.5.0-alpha.3](v1.5.0-alpha.2...v1.5.0-alpha.3) (2026-05-09) ### Features * **cli:** add --parent filter to issues list ([#18](#18)) ([e1e8f21](e1e8f21)), closes [#3](#3) * **cli:** richer filters for issues list ([#17](#17)) ([34d98bd](34d98bd)), closes [#4](#4) * **cli:** show per-resource filters, examples, input field hints in subcommand help ([#19](#19)) ([5818d1e](5818d1e)), closes [#7](#7)
|
🎉 This PR is included in version 1.5.0-alpha.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.5.0](v1.4.0...v1.5.0) (2026-05-09) ### Features * **cli:** add --parent filter to issues list ([#18](#18)) ([e1e8f21](e1e8f21)), closes [#3](#3) * **cli:** add linear cli v2 foundations ([#2](#2)) ([854d165](854d165)) * **cli:** improve help discoverability for subcommands ([#1](#1)) ([702ebce](702ebce)) * **cli:** richer filters for issues list ([#17](#17)) ([34d98bd](34d98bd)), closes [#4](#4) * **cli:** show per-resource filters, examples, input field hints in subcommand help ([#19](#19)) ([5818d1e](5818d1e)), closes [#7](#7)
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #7.
Subcommand help now lists only the inherited globals each handler actually honors (e.g.
templates listshows no pagination,cycles/labels listshow--limit/--cursoronly,issues listshows the full filter set), plus per-resource examples.create/updatehelp calls out required input fields and links to the relevant Linear GraphQL input type inschema.graphql.New
tests/help.test.tscases assert the per-resource scoping so future handlers can't drift from advertised flags.