Skip to content

Conversation

@raegislabs
Copy link

@raegislabs raegislabs commented Nov 6, 2025

Dependencies

Depends on #15 – builds on the issue‑project assignment feature.

Summary

Adds project create and project archive commands, enabling complete project lifecycle management from the CLI.

Builds on PR #15 (issue‑project assignment) to provide a comprehensive project management workflow.

Motivation

Users need to create and archive projects as part of their terminal workflow. Currently, project creation requires using the Linear web interface, which interrupts CLI‑based productivity.

Changes

New Features

  • linctl project create command
    • Required: --name, --team
    • Optional: --description, --state, --priority, --target-date
    • Pre‑API validation for all fields
    • Team key resolution (auto‑converts key to UUID)
  • linctl project archive command
    • Archives project by UUID
    • Displays project name in success message
  • Enhanced test coverage
    • Unit tests for API methods (CreateProject, ArchiveProject, GetTeam)
    • Integration tests for CLI commands
    • Helper function tests

Implementation Details

  • pkg/api/queries.go:
    • Add CreateProject() method with GraphQL mutation
    • Add ArchiveProject() method
    • Enhance GetTeam() to support lookup by key (with ID fallback)
  • cmd/project.go:
    • Add projectCreateCmd with comprehensive validation
    • Add projectArchiveCmd with name display
  • cmd/project_cmd_test.go, cmd/project_test.go: Full test coverage

Usage Examples

# Create project with minimal required fields
linctl project create --name "Q1 Backend Improvements" --team ENG

# Create project with all options
linctl project create \
  --name "API Refactor" \
  --team ENG \
  --description "Stabilize auth flows" \
  --state planned \
  --priority 2 \
  --target-date 2025-03-31

# Archive a project
linctl project archive 3c7b1d1a-1234-5678-9abc-dededededede

Validation

  • State validation: planned|started|paused|completed|canceled
  • Priority validation: 0–4
  • Team key must exist (lookup by key, fallback to id)
  • Target date validated as YYYY‑MM‑DD

Testing

Unit Tests

  • CreateProject / ArchiveProject / GetTeam

Smoke/Build

  • make test (smoke tests) passing
  • make fmt applied

Breaking Changes

None – new commands only.

Architecture Notes

  • Maintains dependency injection style for testability
  • Follows Cobra patterns and output conventions

Checklist

Contributor Checklist (Contributing.md)

  • Go 1.22+ environment
  • make deps as needed
  • make fmt applied
  • make test passes (read‑only smoke tests)
  • No release actions in this PR (handled on tag per Release Checklist)

Implement complete project lifecycle management with create and archive
commands, enabling users to manage projects entirely from the CLI.

Features:
- `linctl project create` with required (name, team) and optional fields
  - Optional: description, state, priority, target-date
  - Team key resolution (auto-converts to UUID)
  - Pre-API validation for state and priority
- `linctl project archive` to archive completed projects
  - Displays project name in success output
- Comprehensive test coverage (API + CLI)

Technical changes:
- pkg/api/queries.go: Add CreateProject(), ArchiveProject(), enhanced GetTeam()
- cmd/project.go: Add projectCreateCmd, projectArchiveCmd
- Tests for API methods and CLI output formats

Examples:
  linctl project create --name "Q1 Backend" --team ENG
  linctl project create --name "API Refactor" --team ENG --state started --priority 2
  linctl project archive <project-uuid>

All acceptance criteria tested against Linear API.
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