Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(issue): add issue archive command - #285

Merged
schpetbot merged 1 commit into
schpet:mainfrom
martin-piliar:feature/issue-archive
Sep 15, 2026
Merged

schpetbot merged 1 commit into
schpet:mainfrom
martin-piliar:feature/issue-archive

Conversation

@martin-piliar

Copy link
Copy Markdown
Contributor

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

  • Uses the issueArchive GraphQL mutation.
  • Prompts with the issue identifier and title unless --confirm or -y is passed.
  • Adds focused mocked-command tests and generated help references.

Testing

  • deno task codegen
  • deno task validate
  • deno task test

Related Issues

Fixes #284

Copilot AI lite review requested due to automatic review settings September 13, 2026 06:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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 the issueArchive(id: $id) GraphQL mutation and a --confirm/-y confirmation 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
schpetbot merged commit 8f66c80 into schpet:main Sep 15, 2026
4 checks passed
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.
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.

Add linear issue archive

3 participants