feat(issue): add issue archive command - #285
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The command implementation matches the stated requirements, uses the correct GraphQL mutation, and includes targeted tests plus documentation updates.
Pull request overview
Adds a new linear issue archive subcommand to expose Linear’s dedicated issue archiving action (distinct from delete/trash) in the CLI, including confirmation behavior, identifier resolution, and updated docs/tests.
Changes:
- Introduces
linear issue archive [issueId]backed by theissueArchive(id: $id)GraphQL mutation and a--confirm/-yconfirmation bypass. - Adds snapshot-based command tests (help text + key non-interactive paths) and snapshots.
- Updates CLI documentation/help references and README usage examples to include the new command.
File summaries
| File | Description |
|---|---|
| test/commands/issue/issue-archive.test.ts | Adds snapshot tests covering help output, confirm flow, and error cases. |
| test/commands/issue/snapshots/issue-archive.test.ts.snap | Stores expected stdout/stderr snapshots for the new tests. |
| src/commands/issue/issue.ts | Registers the new archive subcommand under linear issue. |
| src/commands/issue/issue-archive.ts | Implements issue archiving with identifier resolution, confirmation prompting, and mutation execution. |
| skills/linear-cli/SKILL.md | Adds the new command to the skill command list. |
| skills/linear-cli/references/issue.md | Documents linear issue archive in the generated help reference. |
| README.md | Adds an example invocation for the archive command. |
| docs/usage.md | Adds archive usage documentation alongside existing issue operations. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
schpetbot
pushed a commit
that referenced
this pull request
Sep 15, 2026
Linear's issueArchive answers success for an issue that is already archived, so the new command silently "archived" it a second time. The details query now selects archivedAt and the command says the issue is already archived and returns without prompting or mutating, matching initiative archive. issue archive also gains --bulk, --bulk-file, and --bulk-stdin, mirroring issue delete: the use case behind #284 is cleaning up stale issues, which is many-at-once work, and every other lifecycle command on issues and initiatives already supports it. An already-archived issue counts as done in bulk mode; an unknown one is a per-item failure and the command exits non-zero. The mutation-failure message no longer repeats the handler prefix ("Failed to archive issue: Failed to archive issue"), and the changelog credits the contribution. Claude-Session: https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub
schpetbot
pushed a commit
that referenced
this pull request
Sep 15, 2026
Linear's issueArchive answers success for an issue that is already archived, so the new command silently "archived" it a second time. The details query now selects archivedAt and the command says the issue is already archived and returns without prompting or mutating, matching initiative archive. issue archive also gains --bulk, --bulk-file, and --bulk-stdin, mirroring issue delete: the use case behind #284 is cleaning up stale issues, which is many-at-once work, and every other lifecycle command on issues and initiatives already supports it. An already-archived issue counts as done in bulk mode; an unknown one is a per-item failure and the command exits non-zero. The mutation-failure message no longer repeats the handler prefix ("Failed to archive issue: Failed to archive issue"), and the changelog credits the contribution. Claude-Session: https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub
schpetbot
pushed a commit
that referenced
this pull request
Sep 15, 2026
issue archive (#285) exposes an action Linear's own product hides. Linear's docs state that archiving happens automatically with no option to manually archive items, and the 2021 changelog explains the manual option was removed because most people used the archive as a trash can: the archive is Linear's to manage, deleting is the user's choice. The official Linear MCP server exposes no archive tool either. Nothing in our help or skill said any of this, so an agent reading the command list would treat archive as a normal way to retire an issue. The command's help, docs/usage.md, the README line, and the skill template now say to prefer closing or deleting, quote and link the Linear docs, and note the two practical hazards of calling issueArchive directly: it skips auto-archive's checks for open parents, sub-issues, cycles, and projects, and archived issues drop out of list, query, and search unless --include-archived is passed. The generated skill reference and help snapshot follow from the new description.
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.
What
Adds the linear issue archive command with confirmation, identifier resolution, tests, and command documentation.
Why
The CLI supported deletion/trashing an issue but did not expose Linear's distinct archive action.
How
Testing
Related Issues
Fixes #284