Skip to content

Add initiative, label, and bulk operation support#1

Merged
skgbafa merged 11 commits into
mainfrom
add-cli-intiatives
Jan 18, 2026
Merged

Add initiative, label, and bulk operation support#1
skgbafa merged 11 commits into
mainfrom
add-cli-intiatives

Conversation

@skgbafa

@skgbafa skgbafa commented Jan 18, 2026

Copy link
Copy Markdown
Owner

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

🤖 Generated with Claude Code

skgbafa and others added 10 commits January 17, 2026 20:57
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
@skgbafa

skgbafa commented Jan 18, 2026

Copy link
Copy Markdown
Owner Author

New commands work as expected

@skgbafa skgbafa merged commit 3e51230 into main Jan 18, 2026
@skgbafa skgbafa deleted the add-cli-intiatives branch January 18, 2026 10:17
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