Skip to content

feat: add project creation and archival commands#16

Closed
raegislabs wants to merge 2 commits intodorkitude:masterfrom
raegislabs:pr/project-create-archive
Closed

feat: add project creation and archival commands#16
raegislabs wants to merge 2 commits intodorkitude:masterfrom
raegislabs:pr/project-create-archive

Conversation

@raegislabs
Copy link
Copy Markdown

@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.
@dorkitude
Copy link
Copy Markdown
Owner

Thanks for the thoughtful contribution here, and for the clear implementation notes and examples.

Closing this as superseded by newer merged work on master that now covers (and expands) this functionality:

  • Project CRUD + archive-by-default delete flow
  • Issue project/milestone linking

Relevant docs:

Reproducing your command examples for reference:

# 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

Current equivalent for archive in master:

# Archive (soft-delete) a project
linctl project delete PROJECT-ID

# Permanently delete a project
linctl project delete PROJECT-ID --permanent --force

And for issue-project assignment from the prerequisite flow:

linctl issue update LIN-123 --project "Q1 Platform"
linctl issue update LIN-123 --project "Q1 Platform" --project-milestone "Phase 1"

@dorkitude
Copy link
Copy Markdown
Owner

Closing as superseded by merged work on master (project CRUD/archive + issue project/milestone linking), with the equivalent command paths documented in README.

@dorkitude dorkitude closed this Feb 28, 2026
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.

2 participants