Skip to content

Commit 712e428

Browse files
committed
update skill template with dense command reference overview
All subcommands are now shown one-per-line with all their flags, replacing the previous top-level-only command list. Universal flags (-h/--help and -w/--workspace) are omitted since they apply everywhere. Updates generate-docs.ts to extract flags from help text and recursively collect leaf subcommands for the dense format.
1 parent 4007ac7 commit 712e428

4 files changed

Lines changed: 143 additions & 38 deletions

File tree

skills/linear-cli/SKILL.md

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,79 @@ linear issue comment add ENG-123 --body-file /tmp/comment.md
5959

6060
**Only use inline flags** (`--description`, `--body`) for simple, single-line content.
6161

62-
## Available Commands
62+
## Command Reference
63+
64+
All subcommands with flags (omitting universal `-h/--help` and `-w/--workspace`):
6365

6466
```
65-
linear auth # Manage Linear authentication
66-
linear issue # Manage Linear issues
67-
linear team # Manage Linear teams
68-
linear project # Manage Linear projects
69-
linear project-update # Manage project status updates
70-
linear cycle # Manage Linear team cycles
71-
linear milestone # Manage Linear project milestones
72-
linear initiative # Manage Linear initiatives
73-
linear initiative-update # Manage initiative status updates (timeline posts)
74-
linear label # Manage Linear issue labels
75-
linear document # Manage Linear documents
76-
linear config # Interactively generate .linear.toml configuration
77-
linear schema # Print the GraphQL schema to stdout
78-
linear api # Make a raw GraphQL API request
67+
linear auth login [--key <key>] # Add a workspace credential
68+
linear auth logout [--force] # Remove a workspace credential
69+
linear auth list # List configured workspaces
70+
linear auth default # Set the default workspace
71+
linear auth token # Print the configured API token
72+
linear auth whoami # Print information about the authenticated user
73+
linear issue id # Print the issue based on the current git branch
74+
linear issue list [--state <state>] [--all-states] [--assignee <assignee>] [--all-assignees] [--unassigned] [--sort <sort>] [--team <team>] [--project <project>] [--cycle <cycle>] [--limit <limit>] [--web] [--app] [--no-pager] # List your issues
75+
linear issue title # Print the issue title
76+
linear issue start [--all-assignees] [--unassigned] [--from-ref <fromRef>] [--branch <branch>] # Start working on an issue
77+
linear issue view [--web] [--app] [--no-comments] [--no-pager] [--json] [--no-download] # View issue details (default) or open in browser/app
78+
linear issue url # Print the issue URL
79+
linear issue describe [--references] # Print the issue title and Linear-issue trailer
80+
linear issue commits # Show all commits for a Linear issue (jj only)
81+
linear issue pull-request [--base <branch>] [--draft] [--title <title>] [--web] [--head <branch>] # Create a GitHub pull request with issue details
82+
linear issue delete [--confirm] [--bulk <ids...>] [--bulk-file <file>] [--bulk-stdin] # Delete an issue
83+
linear issue create [--start] [--assignee <assignee>] [--due-date <dueDate>] [--parent <parent>] [--priority <priority>] [--estimate <estimate>] [--description <description>] [--description-file <path>] [--label <label>] [--team <team>] [--project <project>] [--state <state>] [--milestone <milestone>] [--cycle <cycle>] [--no-use-default-template] [--no-interactive] [--title <title>] # Create a linear issue
84+
linear issue update [--assignee <assignee>] [--due-date <dueDate>] [--parent <parent>] [--priority <priority>] [--estimate <estimate>] [--description <description>] [--description-file <path>] [--label <label>] [--team <team>] [--project <project>] [--state <state>] [--milestone <milestone>] [--cycle <cycle>] [--title <title>] # Update a linear issue
85+
linear issue comment add [--body <text>] [--body-file <path>] [--parent <id>] [--attach <filepath>] # Add a comment to an issue or reply to a comment
86+
linear issue comment delete # Delete a comment
87+
linear issue comment update [--body <text>] [--body-file <path>] # Update an existing comment
88+
linear issue comment list [--json] # List comments for an issue
89+
linear issue attach [--title <title>] [--comment <body>] # Attach a file to an issue
90+
linear issue relation add # Add a relation between two issues
91+
linear issue relation delete # Delete a relation between two issues
92+
linear issue relation list # List relations for an issue
93+
linear team create [--name <name>] [--description <description>] [--key <key>] [--private] [--no-interactive] # Create a linear team
94+
linear team delete [--move-issues <targetTeam>] [--force] # Delete a Linear team
95+
linear team list [--web] [--app] # List teams
96+
linear team id # Print the configured team id
97+
linear team autolinks # Configure GitHub repository autolinks for Linear issues with this team prefix
98+
linear team members [--all] # List team members
99+
linear project list [--team <team>] [--all-teams] [--status <status>] [--web] [--app] [--json] # List projects
100+
linear project view [--web] [--app] # View project details
101+
linear project create [--name <name>] [--description <description>] [--team <team>] [--lead <lead>] [--status <status>] [--start-date <startDate>] [--target-date <targetDate>] [--initiative <initiative>] [--interactive] [--json] # Create a new Linear project
102+
linear project update [--name <name>] [--description <description>] [--status <status>] [--lead <lead>] [--start-date <startDate>] [--target-date <targetDate>] [--team <team>] # Update a Linear project
103+
linear project delete [--force] # Delete (trash) a Linear project
104+
linear project-update create [--body <body>] [--body-file <path>] [--health <health>] [--interactive] # Create a new status update for a project
105+
linear project-update list [--json] [--limit <limit>] # List status updates for a project
106+
linear cycle list [--team <team>] # List cycles for a team
107+
linear cycle view [--team <team>] # View cycle details
108+
linear milestone list [--project <projectId>] # List milestones for a project
109+
linear milestone view # View milestone details
110+
linear milestone create [--project <projectId>] [--name <name>] [--description <description>] [--target-date <date>] # Create a new project milestone
111+
linear milestone update [--name <name>] [--description <description>] [--target-date <date>] [--sort-order <value>] [--project <projectId>] # Update an existing project milestone
112+
linear milestone delete [--force] # Delete a project milestone
113+
linear initiative list [--status <status>] [--all-statuses] [--owner <owner>] [--web] [--app] [--json] [--archived] # List initiatives
114+
linear initiative view [--web] [--app] [--json] # View initiative details
115+
linear initiative create [--name <name>] [--description <description>] [--status <status>] [--owner <owner>] [--target-date <targetDate>] [--color <color>] [--icon <icon>] [--interactive] # Create a new Linear initiative
116+
linear initiative archive [--force] [--bulk <ids...>] [--bulk-file <file>] [--bulk-stdin] # Archive a Linear initiative
117+
linear initiative update [--name <name>] [--description <description>] [--status <status>] [--owner <owner>] [--target-date <targetDate>] [--color <color>] [--icon <icon>] [--interactive] # Update a Linear initiative
118+
linear initiative unarchive [--force] # Unarchive a Linear initiative
119+
linear initiative delete [--force] [--bulk <ids...>] [--bulk-file <file>] [--bulk-stdin] # Permanently delete a Linear initiative
120+
linear initiative add-project [--sort-order <sortOrder>] # Link a project to an initiative
121+
linear initiative remove-project [--force] # Unlink a project from an initiative
122+
linear initiative-update create [--body <body>] [--body-file <path>] [--health <health>] [--interactive] # Create a new status update for an initiative
123+
linear initiative-update list [--json] [--limit <limit>] # List status updates for an initiative
124+
linear label list [--team <teamKey>] [--all] [--json] # List issue labels
125+
linear label create [--name <name>] [--color <color>] [--description <description>] [--team <teamKey>] [--interactive] # Create a new issue label
126+
linear label delete [--team <teamKey>] [--force] # Delete an issue label
127+
linear document list [--project <project>] [--issue <issue>] [--json] [--limit <limit>] # List documents
128+
linear document view [--raw] [--web] [--json] # View a document's content
129+
linear document create [--title <title>] [--content <content>] [--content-file <path>] [--project <project>] [--issue <issue>] [--icon <icon>] [--interactive] # Create a new document
130+
linear document update [--title <title>] [--content <content>] [--content-file <path>] [--icon <icon>] [--edit] # Update an existing document
131+
linear document delete [--yes] [--bulk <ids...>] [--bulk-file <file>] [--bulk-stdin] # Delete a document (moves to trash)
132+
linear config # Interactively generate .linear.toml configuration
133+
linear schema [--json] [--output <file>] # Print the GraphQL schema to stdout
134+
linear api [--variable <variable>] [--variables-json <json>] [--paginate] [--silent] # Make a raw GraphQL API request
79135
```
80136

81137
## Reference Documentation

skills/linear-cli/SKILL.template.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ linear issue comment add ENG-123 --body-file /tmp/comment.md
5959

6060
**Only use inline flags** (`--description`, `--body`) for simple, single-line content.
6161

62-
## Available Commands
62+
## Command Reference
63+
64+
All subcommands with flags (omitting universal `-h/--help` and `-w/--workspace`):
6365

6466
{{COMMANDS}}
6567

skills/linear-cli/references/issue.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,22 @@ Description:
7070
7171
Options:
7272
73-
-h, --help - Show this help.
74-
-w, --workspace <slug> - Target workspace (uses credentials)
75-
-s, --state <state> - Filter by issue state (can be repeated for multiple states) (Default: [ "unstarted" ], Values: "triage", "backlog",
76-
"unstarted", "started", "completed", "canceled")
77-
--all-states - Show issues from all states
78-
--assignee <assignee> - Filter by assignee (username)
79-
-A, --all-assignees - Show issues for all assignees
80-
-U, --unassigned - Show only unassigned issues
81-
--sort <sort> - Sort order (can also be set via LINEAR_ISSUE_SORT) (Values: "manual", "priority")
82-
--team <team> - Team to list issues for (if not your default team)
83-
--project <project> - Filter by project name
84-
--cycle <cycle> - Filter by cycle name, number, or 'active'
85-
--milestone <milestone> - Filter by project milestone name (requires --project)
86-
--limit <limit> - Maximum number of issues to fetch (default: 50, use 0 for unlimited) (Default: 50)
87-
-w, --web - Open in web browser
88-
-a, --app - Open in Linear.app
89-
--no-pager - Disable automatic paging for long output
73+
-h, --help - Show this help.
74+
-w, --workspace <slug> - Target workspace (uses credentials)
75+
-s, --state <state> - Filter by issue state (can be repeated for multiple states) (Default: [ "unstarted" ], Values: "triage", "backlog",
76+
"unstarted", "started", "completed", "canceled")
77+
--all-states - Show issues from all states
78+
--assignee <assignee> - Filter by assignee (username)
79+
-A, --all-assignees - Show issues for all assignees
80+
-U, --unassigned - Show only unassigned issues
81+
--sort <sort> - Sort order (can also be set via LINEAR_ISSUE_SORT) (Values: "manual", "priority")
82+
--team <team> - Team to list issues for (if not your default team)
83+
--project <project> - Filter by project name
84+
--cycle <cycle> - Filter by cycle name, number, or 'active'
85+
--limit <limit> - Maximum number of issues to fetch (default: 50, use 0 for unlimited) (Default: 50)
86+
-w, --web - Open in web browser
87+
-a, --app - Open in Linear.app
88+
--no-pager - Disable automatic paging for long output
9089
```
9190

9291
### title

skills/linear-cli/scripts/generate-docs.ts

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,64 @@ function generateIndex(commands: CommandInfo[], version: string): string {
298298
return lines.join("\n") + "\n"
299299
}
300300

301+
function extractCompactFlags(helpText: string): string {
302+
const flagParts: string[] = []
303+
const lines = helpText.split("\n")
304+
let inOptions = false
305+
306+
for (const line of lines) {
307+
if (/^Options:/.test(line)) {
308+
inOptions = true
309+
continue
310+
}
311+
if (inOptions) {
312+
if (/^(Commands:|Examples:|Arguments:)/.test(line)) break
313+
if (!line.match(/^ {2}-/)) continue
314+
// Match: "-X, --long-name" or "--long-name" or "-X" optionally followed by <arg>
315+
const m = line.match(
316+
/^ {2,}(-[a-zA-Z](?:,\s+--[-a-zA-Z0-9]+)*|--[-a-zA-Z0-9]+)(?:\s+<([^>]+)>)?/,
317+
)
318+
if (!m) continue
319+
const flagStr = m[1].trim()
320+
const argStr = m[2]
321+
// Skip universal flags: -h/--help and --workspace
322+
if (flagStr.includes("--help")) continue
323+
if (flagStr.includes("--workspace")) continue
324+
// Prefer long form for readability
325+
const longMatch = flagStr.match(/--[-a-zA-Z0-9]+/)
326+
const primaryFlag = longMatch
327+
? longMatch[0]
328+
: flagStr.split(",")[0].trim()
329+
const part = argStr ? `${primaryFlag} <${argStr}>` : primaryFlag
330+
flagParts.push(`[${part}]`)
331+
}
332+
}
333+
334+
return flagParts.join(" ")
335+
}
336+
337+
function getAllLeafCommands(
338+
cmd: CommandInfo,
339+
): { name: string; description: string; help: string }[] {
340+
if (cmd.subcommands.length === 0) {
341+
return [{ name: cmd.name, description: cmd.description, help: cmd.help }]
342+
}
343+
return cmd.subcommands.flatMap(getAllLeafCommands)
344+
}
345+
301346
function generateCommandsSection(commands: CommandInfo[]): string {
302347
const lines: string[] = []
303348
lines.push("```")
304349

305-
// Find max command name length for alignment
306-
const maxLen = Math.max(...commands.map((c) => c.name.length))
307-
308350
for (const cmd of commands) {
309-
const padding = " ".repeat(maxLen - cmd.name.length + 2)
310-
lines.push(`linear ${cmd.name}${padding}# ${cmd.description}`)
351+
const leafCmds = getAllLeafCommands(cmd)
352+
for (const leaf of leafCmds) {
353+
const flags = extractCompactFlags(leaf.help)
354+
const cmdStr = flags
355+
? `linear ${leaf.name} ${flags}`
356+
: `linear ${leaf.name}`
357+
lines.push(`${cmdStr} # ${leaf.description}`)
358+
}
311359
}
312360

313361
lines.push("```")

0 commit comments

Comments
 (0)