Skip to content

feat(initiative): add initiative CRUD commands#55

Open
t-choudhury wants to merge 1 commit into
dorkitude:masterfrom
t-choudhury:feat/initiative-command
Open

feat(initiative): add initiative CRUD commands#55
t-choudhury wants to merge 1 commit into
dorkitude:masterfrom
t-choudhury:feat/initiative-command

Conversation

@t-choudhury
Copy link
Copy Markdown

@t-choudhury t-choudhury commented May 29, 2026

Summary

Adds full initiative management commands to linctl, covering the Linear initiative API surface.

New Commands

Command Description
linctl initiative list List initiatives with status/completion filtering
linctl initiative get Rich detail view with projects, sub-initiatives, updates
linctl initiative create Create with name, description, owner, status, target date
linctl initiative update Update any field including owner/status/target date
linctl initiative delete Permanent delete with confirmation
linctl initiative archive Soft-delete (archive)
linctl initiative unarchive Restore archived initiative
linctl initiative link Link initiative to a project
linctl initiative unlink Unlink initiative from project (two-step edge lookup)

Architecture

Follows the same patterns as cmd/project.go:

  • Tri-mode output (table, plaintext, JSON)
  • viper for global flag binding
  • api.Client methods in pkg/api/queries.go
  • Status validation against InitiativeStatus enum (Planned, Active, Completed)
  • Owner resolution supporting email, name, or me

Changes

  • pkg/api/queries.go: Expanded Initiative struct (3 → 20+ fields), added Initiatives, InitiativeToProject, InitiativeUpdates types, and 10 API client methods
  • cmd/initiative.go (new): All 9 subcommands with Cobra command definitions
  • cmd/initiative_cmd_test.go (new): Unit tests for registration, flags, aliases, status normalization
  • README.md: Features list, Quick Start examples, Command Reference
  • SKILL.md: Command map, read/write patterns, discovery commands
  • master_api_ref.md: API mapping table

Testing

  • go build ./...
  • go test ./...
  • go vet ./...
  • Live smoke tested against a real workspace (list, get, table/plaintext/JSON)

Add full initiative management to linctl:
- list/get/create/update/delete/archive/unarchive subcommands
- link/unlink for initiative-to-project associations
- Tri-mode output: table, plaintext, JSON
- Status filtering (Planned/Active/Completed)
- Owner resolution (email, name, "me")
- Two-step unlink via initiativeToProject edge lookup
- Unit tests for command registration, flags, and status normalization
- Documentation in README.md, SKILL.md, and master_api_ref.md
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