diff --git a/src/cli/handlers/worktree.ts b/src/cli/handlers/worktree.ts index b051479a43d..eda99c4b3b3 100644 --- a/src/cli/handlers/worktree.ts +++ b/src/cli/handlers/worktree.ts @@ -161,6 +161,7 @@ export const WORKTREE_HANDLERS: Record = { displayName: getOptionalStringFlag(flags, 'display-name'), linkedIssue: getOptionalNullableNumberFlag(flags, 'issue'), comment: getOptionalStringFlag(flags, 'comment'), + workspaceStatus: getOptionalStringFlag(flags, 'workspace-status'), parentWorktree: await getOptionalWorktreeSelector(flags, 'parent-worktree', cwd, client), noParent: flags.get('no-parent') === true }) diff --git a/src/cli/help.ts b/src/cli/help.ts index 50de2d06059..b5990b63eac 100644 --- a/src/cli/help.ts +++ b/src/cli/help.ts @@ -169,7 +169,7 @@ Common Commands: orca worktree create --repo --name [--base-branch ] [--issue ] [--comment ] [--parent-worktree ] [--no-parent] [--run-hooks] [--activate] [--json] orca worktree show --worktree [--json] orca worktree current [--json] - orca worktree set --worktree [--display-name ] [--issue ] [--comment ] [--parent-worktree |--no-parent] [--json] + orca worktree set --worktree [--display-name ] [--issue ] [--comment ] [--workspace-status ] [--parent-worktree |--no-parent] [--json] orca worktree rm --worktree [--force] [--run-hooks] [--json] orca worktree ps [--limit ] [--json] orca file open [--worktree ] [--json] @@ -388,6 +388,8 @@ export function formatFlagHelp(flag: string): string { worktree: '--worktree Worktree selector such as id:, branch:, issue:, path:, or active/current', workspace: '--workspace Existing worktree selector for automation runs', + 'workspace-status': + '--workspace-status Board status id (defaults: todo, in-progress, in-review, completed)', prompt: '--prompt Automation prompt to pass to the agent', staged: '--staged Open staged source-control changes', provider: '--provider Agent id such as codex, claude, or gemini', diff --git a/src/cli/index.test.ts b/src/cli/index.test.ts index 0cab307f702..8da612f0708 100644 --- a/src/cli/index.test.ts +++ b/src/cli/index.test.ts @@ -427,11 +427,48 @@ describe('orca cli worktree awareness', () => { displayName: undefined, linkedIssue: undefined, comment: undefined, + workspaceStatus: undefined, parentWorktree: undefined, noParent: true }) }) + it('passes workspace status through worktree.set', async () => { + queueFixtures( + callMock, + okFixture('req_set_status', { + worktree: { + ...buildWorktree('/tmp/repo/child', 'feature/child'), + workspaceStatus: 'in-review' + } + }) + ) + vi.spyOn(console, 'log').mockImplementation(() => {}) + + await main( + [ + 'worktree', + 'set', + '--worktree', + 'id:repo::/tmp/repo/child', + '--workspace-status', + 'in-review', + '--json' + ], + '/tmp/repo' + ) + + expect(callMock).toHaveBeenCalledWith('worktree.set', { + worktree: 'id:repo::/tmp/repo/child', + displayName: undefined, + linkedIssue: undefined, + comment: undefined, + workspaceStatus: 'in-review', + parentWorktree: undefined, + noParent: false + }) + }) + it('passes explicit activation through worktree.create', async () => { queueFixtures( callMock, diff --git a/src/cli/specs/core.ts b/src/cli/specs/core.ts index 6eea616b412..37d7881e666 100644 --- a/src/cli/specs/core.ts +++ b/src/cli/specs/core.ts @@ -123,15 +123,19 @@ export const CORE_COMMAND_SPECS: CommandSpec[] = [ path: ['worktree', 'set'], summary: 'Update Orca metadata for a worktree', usage: - 'orca worktree set --worktree [--display-name ] [--issue ] [--comment ] [--parent-worktree |--no-parent] [--json]', + 'orca worktree set --worktree [--display-name ] [--issue ] [--comment ] [--workspace-status ] [--parent-worktree |--no-parent] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'worktree', 'display-name', 'issue', 'comment', + 'workspace-status', 'parent-worktree', 'no-parent' + ], + notes: [ + 'Workspace status ids match the board columns (defaults: todo, in-progress, in-review, completed); custom statuses use their configured id.' ] }, {