Skip to content

Conversation

@skgbafa
Copy link

@skgbafa skgbafa commented Jan 18, 2026

I have been using this CLI as my primary driver for using linear with Claude + other agentic tools and we use initiatives + labels heavily in our workflow. This is usually done by making direct GraphQL queries, which includes mistakes, retries and clutters up the context window compared to an ivocation of the CLI. I've added our commonly used methods and tested them.

This was created based on GraphQL calls I have used and some delete methods have been included. They require confirmation, but could be removed from here. They make it possible to do more complex refactors with an LLM. They have been tested as well.

Would love to have this merge to make it easy to install this update in various configurations. Happy to answer any questions

Summary

This PR adds several major features to linear-cli:

  • Initiative management: Full CRUD support for initiatives including list, view, create, archive, unarchive, update, and delete commands
  • Initiative-project linking: Commands to add and remove projects from initiatives
  • Label management: List, create, and delete commands for labels with team filtering
  • Project creation: New project create command with interactive mode and initiative linking
  • Team deletion: New team delete command with confirmation
  • Bulk operations: New utility supporting bulk operations across commands (issue delete now supports multiple IDs)

New Commands

Initiatives

  • linear initiative list - List all initiatives with filtering options
  • linear initiative view <id> - View initiative details including linked projects
  • linear initiative create - Create new initiative (interactive or via flags)
  • linear initiative archive <id> - Archive an initiative
  • linear initiative unarchive <id> - Unarchive an initiative
  • linear initiative update <id> - Update initiative properties
  • linear initiative delete <id> - Delete an initiative (with confirmation)
  • linear initiative add-project - Link a project to an initiative
  • linear initiative remove-project - Remove project from initiative

Labels

  • linear label list - List labels with optional team filter
  • linear label create - Create a new label
  • linear label delete <id> - Delete a label

Projects

  • linear project create - Create a new project with team, lead, dates, status, and optional initiative linking

Teams

  • linear team delete <id> - Delete a team (with confirmation)

Test plan

  • Verify linear initiative list shows initiatives
  • Verify linear initiative view <id> displays initiative details
  • Verify linear initiative create works in both interactive and CLI modes
  • Verify initiative archive/unarchive/delete operations
  • Verify linear label list and linear label create work
  • Verify linear project create creates projects correctly
  • Verify bulk delete works: linear issue delete --bulk ID1 ID2 ID3

skgbafa and others added 5 commits January 18, 2026 05:17
* TC-522: Add team delete and initiative update/unarchive/delete commands

- team delete: with --move-issues option to migrate issues before deletion
- initiative update: update name, description, status, owner, target date, color, icon
- initiative unarchive: restore archived initiatives with confirmation
- initiative delete: permanent deletion with typed name confirmation for safety

All commands include proper safety confirmations for destructive operations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* TC-521: Add bulk operation support across commands

- Add shared bulk utilities (src/utils/bulk.ts):
  - collectBulkIds: supports --bulk, --bulk-file, --bulk-stdin
  - executeBulkOperations: concurrent execution with progress
  - printBulkSummary: formatted output with success/failure details

- Add initiative-archive command with bulk support:
  - Single and bulk archive operations
  - Progress reporting during bulk operations

- Update initiative-delete with bulk support:
  - Add --bulk, --bulk-file, --bulk-stdin flags
  - Refactor into handleSingleDelete/handleBulkDelete

- Update issue-delete with bulk support:
  - Add --bulk, --bulk-file, --bulk-stdin flags
  - Refactor into handleSingleDelete/handleBulkDelete

Example usage:
  linear init archive --bulk id1 id2 id3
  linear issue delete --bulk TC-100 TC-101 TC-102
  linear init archive --bulk-file initiatives-to-archive.txt
  linear issue list --state canceled --output-ids | linear issue delete --bulk-stdin

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* TC-520: Add project create command

- Add project-create.ts with:
  - GraphQL mutations for CreateProject and AddProjectToInitiative
  - Interactive mode with prompts for name, team, status, lead, dates
  - CLI flags: --name, --team, --description, --lead, --status, --start-date, --target-date, --initiative
  - Team lookup/validation via getTeamIdByKey
  - Status lookup from actual project statuses in org
  - Optional initiative linking at creation time
- Register create command in project.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* TC-519: Add label list, create, and delete commands

- Add label command with list, create, delete subcommands
- label list: workspace/team filtering, JSON output
- label create: name, color, description, team; interactive mode
- label delete: by name or ID with team disambiguation
- Register label command in main.ts with alias "l"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* TC-518: Add initiative add-project and remove-project commands

Adds two new subcommands for linking projects to initiatives:

- `linear init add-project <initiative> <project>`: Link a project to an initiative
- `linear init remove-project <initiative> <project>`: Unlink a project from an initiative

Features:
- Resolve initiatives/projects by UUID, slug, or name (case-insensitive)
- Optional --sort-order for add-project to set position
- Confirmation prompt for remove-project (skip with -y/--force)
- Proper error handling for already-linked or not-linked cases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* TC-517: Add initiative create command

- New initiative-create.ts with name, description, status, owner,
  target-date, color, and icon options
- Supports both interactive mode (prompts) and flag-based creation
- Status options: planned, active, paused, completed, canceled
- Owner lookup via username, email, or @me
- Registered create subcommand in initiative.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* TC-516: Implement initiative list and view commands

- Add initiative-list.ts:
  - Lists initiatives with filtering by status, owner, archived
  - Default: active only, use --all-statuses for all
  - Table output with SLUG, NAME, STATUS, HEALTH, OWNER, PROJ, TARGET
  - Color-coded status display
  - Supports --json, --web, --app options

- Add initiative-view.ts:
  - View initiative details by UUID, slug, or name
  - Shows info, description, and linked projects grouped by status
  - Supports --json, --web, --app options

- Update initiative.ts to register list (alias: ls) and view commands

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* build fixes

* Fix GraphQL schema issues for initiative commands

- Rename duplicate GetInitiativeDetails to GetInitiativeForUpdate
- Fix initiativeToProjects query (API doesn't support filter, use client-side filtering)
- Fix initiativeUnarchive return type (use 'entity' not 'initiative')
- Fix initiative status enum values (Planned, Active, Completed - capitalized)
- Fix initiative list archivedAt filter (use includeArchived query param instead)

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* Fix label commands

- Add label ID column to label list output
- Fix label delete error handling for invalid input
- Fix initiative unarchive to query with includeArchived

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* update skill

---------

Co-authored-by: Claude <[email protected]>
Add { collect: true } to the --label option to allow repeated flags:
  linear issue create --label Feature --label AI --label Bug

Changes:
- Use Cliffy collect option for repeatable --label flag
- Simplify null checks (labels != null instead of !== true)
- Update help text snapshots
* TC-535: Add tests and update documentation for document commands

- Create test files for all 5 document subcommands:
  - document-list.test.ts: tests for listing documents with filters
  - document-view.test.ts: tests for viewing document content
  - document-create.test.ts: tests for creating documents
  - document-update.test.ts: tests for updating documents
  - document-delete.test.ts: tests for soft/permanent deletion
- Update README.md with document command usage examples
- Tests follow existing patterns using MockLinearServer and snapshot testing
- Tests will compile once command implementations are completed

* TC-534: Implement document delete command

- Create document-delete.ts with soft delete support
- Linear API only supports soft delete (moves to trash), no permanent deletion
- Implemented single delete with confirmation prompt and -y flag to skip
- Implemented bulk delete with --bulk, --bulk-file, and --bulk-stdin support
- Updated document-delete.test.ts to match implementation

* TC-533: Implement document update command

Add document-update.ts with partial update support:
- --title: Update document title
- --content: Inline content update
- --content-file: Read content from file
- --icon: Update document icon
- --edit: Open current content in $EDITOR for editing

Includes openEditorWithContent helper for --edit mode that fetches
current document content, opens editor, and submits changes.

* TC-532: Implement document create command

Add document-create.ts with full support for creating Linear documents:
- Support for --title, --content, --content-file, --project, --issue, --icon flags
- Content resolution from inline, file, stdin, and $EDITOR
- Interactive mode (-i) with prompts for all fields
- Project and issue attachment support

Also creates document.ts parent command and registers it in main.ts.

* added support for documents

* fix doc bug

* enable updates from cli
- Add deepEqual method to mock server for nested object comparison
- Add stdin timeout to document-create and document-update commands
- Only read from stdin when no other update fields provided
- Fix bulk delete test arg ordering (-y before --bulk)
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.

1 participant