Skip to content

Conversation

@raegislabs
Copy link

@raegislabs raegislabs commented Nov 6, 2025

Dependencies

None

Resolves

Fixes #12

Summary

Adds --project flag to issue create and issue update commands, enabling complete issue‑project workflow management from the CLI without switching to Linear's web UI.

Motivation

Issue #12 requested the ability to specify project when creating/updating issues. This implements that feature with comprehensive validation and error handling.

Changes

New Features

  • --project flag for issue create and issue update commands
    • Accepts project UUID to assign issue to a project
    • Accepts unassigned to remove project assignment
  • UUID validation before API calls to provide clear errors early
  • Project display in all output formats (table, plaintext, JSON)

Implementation Details

  • cmd/issue.go: Flag registration, input building, UUID validation, error handling
  • pkg/api/queries.go: GraphQL mutations updated to include project field
  • Comprehensive unit tests for flag parsing and validation

Usage Examples

# Create issue assigned to a project
linctl issue create --title "Fix login bug" --team ENG --project 61829105-0c68-43c0-8422-1cb09950cd29

# Assign existing issue to project
linctl issue update ISS-123 --project 61829105-0c68-43c0-8422-1cb09950cd29

# Remove project assignment
linctl issue update ISS-123 --project unassigned

# View project in output
linctl issue get ISS-123  # Shows "Project: linctl"

Validation

  • UUID format validation for --project
  • unassigned is accepted to remove project assignment
  • Clear error messages for invalid UUIDs

Testing

Unit Tests

  • Flag registration and help text
  • Flag parsing and defaults
  • Input validation (UUID format)
  • Error scenarios

Smoke/Build

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

Breaking Changes

None – additive flags only.

Architecture Notes

  • Maintains dependency injection and Cobra flag patterns
  • Uses explicit flag checks and normalization helper for project input

Checklist

  • Tests added and passing
  • Code follows existing patterns
  • Help text updated and matches behavior
  • Manual testing completed
  • No breaking changes
  • Smoke tests passing

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)

Add --project flag to issue create and update commands, enabling
complete issue-project workflow management from the CLI.

Features:
- --project flag accepts project UUID or 'unassigned'
- UUID format validation before API calls
- Clear error messages for invalid projects
- Project display in all output formats (table, plaintext, JSON)

Technical changes:
- cmd/issue.go: Add flag registration and input handling
- pkg/api/queries.go: Include project field in GraphQL queries
- Add comprehensive unit tests for flag parsing

All acceptance criteria tested against Linear API.

Examples:
  linctl issue create --title "Bug" --team ENG --project <uuid>
  linctl issue update ISS-123 --project <uuid>
  linctl issue update ISS-123 --project unassigned
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.

Feature Request: Add an issue to a project

1 participant