Skip to content

Conversation

@ralfschimmel
Copy link

Summary

  • Add read, create, update, and archive commands to the projects CLI
  • Migrate list from SDK to GraphQL with --include-archived option
  • Follow established patterns from project-milestones.ts

New Commands

projects list [--limit <n>] [--include-archived]
projects read <projectIdOrName> [--milestones-first <n>] [--issues-first <n>]
projects create <name> --team <team> [-d <desc>] [--icon] [--color] [--lead] [--priority] [--start-date] [--target-date]
projects update <projectIdOrName> [-n <name>] [-d <desc>] [--lead|--clear-lead] [--start-date|--clear-start-date] [--target-date|--clear-target-date]
projects archive <projectIdOrName>

Implementation Details

  • GraphQL optimization: All commands use GraphQL queries, avoiding N+1 problems
  • Name-based resolution: Accepts project name or UUID for all commands
  • Output transformation: Normalizes GraphQL { nodes: [...] } to flat arrays for consistency
  • Validation: Mutually exclusive flags validated before API calls
  • Error handling: Uses notFoundError and multipleMatchesError helpers

Files Changed

  • src/queries/projects.ts (new) - GraphQL queries and mutations
  • src/commands/projects.ts - Full CRUD implementation
  • src/utils/linear-types.d.ts - Type definitions for options
  • tests/integration/projects-cli.test.ts (new) - Integration tests

Test Plan

  • All 17 integration tests pass (14 run, 3 skipped for create/update/archive to avoid modifying production data)
  • Manual testing: list, read, create, update, clear flags, archive all verified working
  • Build passes with no TypeScript errors

🤖 Generated with Claude Code

Ralf Schimmel and others added 3 commits December 15, 2025 09:50
Add support for managing issue relationships through a new `issues relations`
subcommand group. This enables tracking dependencies between issues, which is
essential for AI agents that need to understand task ordering and blockers.

New commands:
- `issues relations list <issueId>` - List all relations for an issue
- `issues relations add <issueId> --blocks|--related|--duplicate|--similar <ids>`
- `issues relations remove <relationId>` - Remove a relation by UUID

Features:
- Support for all Linear relation types: blocks, related, duplicate, similar
- Comma-separated IDs for adding multiple relations at once
- Human-friendly ID resolution (TEAM-123 format)
- Relations included in `issues read` output
- Both outgoing and inverse relations combined in output

Technical details:
- Optimized GraphQL queries with new ISSUE_RELATIONS_FRAGMENT
- Proper validation for null/undefined nested relation data
- UUID validation for relation removal
- Partial success reporting when batch relation creation fails
- Comprehensive unit tests (23 tests) and integration tests

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add read, create, update, and archive commands to the projects CLI:
- projects list: Migrated from SDK to GraphQL with --include-archived option
- projects read: Get project details including milestones and issues
- projects create: Create project with required team and optional fields
- projects update: Update any project field with --clear-* flags for nullables
- projects archive: Soft-delete a project

Implementation follows existing patterns from project-milestones.ts:
- GraphQL queries with fragments for optimization
- Name-based ID resolution with multiple match handling
- Type definitions for command options
- Integration tests for all commands

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use GraphQL @Skip directive to conditionally exclude milestones and
issues when 0 is passed, since Linear API requires first >= 1.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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