diff --git a/src/commands/issues.ts b/src/commands/issues.ts index e571b21..f7e9a1b 100644 --- a/src/commands/issues.ts +++ b/src/commands/issues.ts @@ -252,6 +252,9 @@ export function setupIssuesCommands(program: Command): void { "set cycle (can use name or ID, will try to resolve within team context first)", ) .option("--clear-cycle", "clear existing cycle assignment") + .optionsGroup("Estimate-related options:") + .option("--estimate ", "set point estimate") + .option("--clear-estimate", "clear existing point estimate") .action( handleAsyncCommand( async (issueId: string, options: any, command: Command) => { @@ -276,6 +279,13 @@ export function setupIssuesCommands(program: Command): void { ); } + // Check for mutually exclusive estimate flags + if (options.estimate && options.clearEstimate) { + throw new Error( + "Cannot use --estimate and --clear-estimate together", + ); + } + // Validate label operation flags if (options.labelBy && !options.labels) { throw new Error( @@ -339,6 +349,9 @@ export function setupIssuesCommands(program: Command): void { milestoneId: options.projectMilestone || (options.clearProjectMilestone ? null : undefined), cycleId: options.cycle || (options.clearCycle ? null : undefined), + estimate: options.estimate + ? parseInt(options.estimate) + : (options.clearEstimate ? null : undefined), }; const labelMode = options.labelBy || "adding"; diff --git a/src/utils/linear-types.d.ts b/src/utils/linear-types.d.ts index ec24d51..e71999b 100644 --- a/src/utils/linear-types.d.ts +++ b/src/utils/linear-types.d.ts @@ -115,7 +115,7 @@ export interface UpdateIssueArgs { assigneeId?: string; projectId?: string; labelIds?: string[]; - estimate?: number; + estimate?: number | null; parentId?: string; milestoneId?: string | null; cycleId?: string | null;