Skip to content

feat(cli): richer subcommand help with per-resource filters and input hints#19

Merged
dubscode merged 2 commits intomainfrom
feat/issue-7-help-completeness
May 9, 2026
Merged

feat(cli): richer subcommand help with per-resource filters and input hints#19
dubscode merged 2 commits intomainfrom
feat/issue-7-help-completeness

Conversation

@dubscode
Copy link
Copy Markdown
Contributor

@dubscode dubscode commented May 9, 2026

Closes #7.

Subcommand help now lists only the inherited globals each handler actually honors (e.g. templates list shows no pagination, cycles/labels list show --limit/--cursor only, issues list shows the full filter set), plus per-resource examples. create/update help calls out required input fields and links to the relevant Linear GraphQL input type in schema.graphql.

New tests/help.test.ts cases assert the per-resource scoping so future handlers can't drift from advertised flags.

Copilot AI review requested due to automatic review settings May 9, 2026 05:25
@dubscode dubscode merged commit 5818d1e into main May 9, 2026
7 checks passed
@dubscode dubscode deleted the feat/issue-7-help-completeness branch May 9, 2026 05:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --input option 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.

Comment on lines +17 to +28
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)}`;
github-actions Bot pushed a commit that referenced this pull request May 9, 2026
# [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)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

🎉 This PR is included in version 1.5.0-alpha.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions Bot pushed a commit that referenced this pull request May 9, 2026
# [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)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show inherited global flags and input fields in command help

2 participants