@proletariat/cli 0.3.16 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/action/create.d.ts +1 -0
- package/dist/commands/action/create.js +74 -38
- package/dist/commands/action/delete.d.ts +1 -0
- package/dist/commands/action/delete.js +23 -24
- package/dist/commands/action/index.d.ts +1 -0
- package/dist/commands/action/index.js +5 -10
- package/dist/commands/action/list.d.ts +1 -0
- package/dist/commands/action/list.js +3 -1
- package/dist/commands/action/run.d.ts +1 -0
- package/dist/commands/action/run.js +44 -32
- package/dist/commands/action/show.d.ts +2 -0
- package/dist/commands/action/update.d.ts +1 -0
- package/dist/commands/action/update.js +80 -39
- package/dist/commands/agent/auth.d.ts +2 -0
- package/dist/commands/agent/auth.js +44 -3
- package/dist/commands/agent/discover.d.ts +2 -0
- package/dist/commands/agent/discover.js +35 -3
- package/dist/commands/agent/index.d.ts +1 -0
- package/dist/commands/agent/index.js +25 -45
- package/dist/commands/agent/list.d.ts +8 -3
- package/dist/commands/agent/list.js +16 -29
- package/dist/commands/agent/login.d.ts +1 -0
- package/dist/commands/agent/login.js +14 -32
- package/dist/commands/agent/rebuild.d.ts +1 -0
- package/dist/commands/agent/rebuild.js +2 -2
- package/dist/commands/agent/remove.d.ts +17 -0
- package/dist/commands/agent/remove.js +144 -0
- package/dist/commands/agent/restart.d.ts +1 -0
- package/dist/commands/agent/restart.js +2 -2
- package/dist/commands/agent/shell.d.ts +1 -0
- package/dist/commands/agent/shell.js +63 -76
- package/dist/commands/agent/staff/add.d.ts +1 -0
- package/dist/commands/agent/staff/add.js +7 -1
- package/dist/commands/agent/staff/index.d.ts +1 -0
- package/dist/commands/agent/staff/index.js +5 -4
- package/dist/commands/agent/staff/remove.d.ts +1 -0
- package/dist/commands/agent/status.d.ts +1 -0
- package/dist/commands/agent/status.js +11 -23
- package/dist/commands/agent/temp/cleanup.d.ts +1 -0
- package/dist/commands/agent/temp/index.d.ts +1 -0
- package/dist/commands/agent/temp/index.js +4 -3
- package/dist/commands/agent/themes/index.d.ts +1 -0
- package/dist/commands/agent/themes/index.js +9 -3
- package/dist/commands/agent/themes/set.d.ts +1 -0
- package/dist/commands/agent/themes/set.js +7 -1
- package/dist/commands/agent/visit.d.ts +1 -0
- package/dist/commands/agent/visit.js +11 -23
- package/dist/commands/autocomplete/setup.d.ts +11 -0
- package/dist/commands/autocomplete/setup.js +113 -8
- package/dist/commands/board/index.d.ts +4 -0
- package/dist/commands/board/index.js +32 -30
- package/dist/commands/board/watch.d.ts +2 -0
- package/dist/commands/branch/create.d.ts +1 -0
- package/dist/commands/branch/create.js +33 -41
- package/dist/commands/branch/index.d.ts +1 -0
- package/dist/commands/branch/list.d.ts +2 -0
- package/dist/commands/branch/validate.d.ts +2 -0
- package/dist/commands/branch/where.d.ts +1 -0
- package/dist/commands/claude.d.ts +6 -0
- package/dist/commands/claude.js +166 -116
- package/dist/commands/commit.d.ts +6 -0
- package/dist/commands/commit.js +68 -73
- package/dist/commands/config/index.d.ts +13 -0
- package/dist/commands/config/index.js +142 -98
- package/dist/commands/docker/clean.d.ts +2 -1
- package/dist/commands/docker/clean.js +20 -29
- package/dist/commands/docker/index.d.ts +1 -0
- package/dist/commands/docker/index.js +37 -41
- package/dist/commands/docker/prune.d.ts +2 -1
- package/dist/commands/docker/prune.js +20 -27
- package/dist/commands/docker/restart.d.ts +2 -1
- package/dist/commands/docker/restart.js +20 -29
- package/dist/commands/docker/stop.d.ts +2 -1
- package/dist/commands/docker/stop.js +20 -29
- package/dist/commands/epic/activate.d.ts +1 -0
- package/dist/commands/epic/archive.d.ts +1 -0
- package/dist/commands/epic/create.d.ts +1 -0
- package/dist/commands/epic/index.d.ts +1 -0
- package/dist/commands/epic/link/block.d.ts +1 -0
- package/dist/commands/epic/link/duplicates.d.ts +1 -0
- package/dist/commands/epic/link/index.d.ts +1 -0
- package/dist/commands/epic/link/relates.d.ts +1 -0
- package/dist/commands/epic/link/remove.d.ts +1 -0
- package/dist/commands/epic/list.d.ts +2 -0
- package/dist/commands/epic/move.d.ts +1 -0
- package/dist/commands/epic/progress.d.ts +1 -0
- package/dist/commands/epic/project.d.ts +1 -0
- package/dist/commands/epic/reorder.d.ts +1 -0
- package/dist/commands/epic/spec.d.ts +1 -0
- package/dist/commands/epic/ticket.d.ts +1 -0
- package/dist/commands/epic/view.d.ts +1 -0
- package/dist/commands/execution/index.d.ts +1 -0
- package/dist/commands/execution/index.js +9 -25
- package/dist/commands/execution/list.d.ts +2 -0
- package/dist/commands/execution/logs.d.ts +1 -0
- package/dist/commands/execution/logs.js +6 -16
- package/dist/commands/execution/stop.d.ts +1 -0
- package/dist/commands/execution/stop.js +4 -15
- package/dist/commands/gh/index.d.ts +1 -0
- package/dist/commands/gh/index.js +27 -27
- package/dist/commands/gh/login.d.ts +4 -0
- package/dist/commands/gh/login.js +31 -0
- package/dist/commands/gh/status.d.ts +4 -0
- package/dist/commands/gh/status.js +27 -4
- package/dist/commands/gh/token.d.ts +4 -0
- package/dist/commands/gh/token.js +49 -5
- package/dist/commands/phase/create.d.ts +1 -1
- package/dist/commands/phase/create.js +116 -74
- package/dist/commands/phase/delete.d.ts +1 -0
- package/dist/commands/phase/delete.js +23 -22
- package/dist/commands/phase/list.d.ts +1 -0
- package/dist/commands/phase/list.js +3 -5
- package/dist/commands/phase/move.d.ts +1 -0
- package/dist/commands/phase/move.js +39 -39
- package/dist/commands/phase/template/apply.d.ts +1 -0
- package/dist/commands/phase/template/create.d.ts +2 -0
- package/dist/commands/phase/template/delete.d.ts +1 -0
- package/dist/commands/phase/template/index.d.ts +1 -0
- package/dist/commands/phase/template/list.d.ts +1 -0
- package/dist/commands/phase/template/update.d.ts +2 -0
- package/dist/commands/phase/update.d.ts +1 -1
- package/dist/commands/phase/update.js +89 -55
- package/dist/commands/pmo/init.d.ts +2 -0
- package/dist/commands/pmo/init.js +84 -22
- package/dist/commands/pr/create.d.ts +12 -3
- package/dist/commands/pr/create.js +130 -147
- package/dist/commands/pr/index.d.ts +6 -3
- package/dist/commands/pr/index.js +41 -39
- package/dist/commands/pr/link.d.ts +7 -3
- package/dist/commands/pr/link.js +126 -150
- package/dist/commands/pr/status.d.ts +6 -3
- package/dist/commands/pr/status.js +101 -126
- package/dist/commands/project/archive.d.ts +1 -0
- package/dist/commands/project/archive.js +15 -20
- package/dist/commands/project/create.d.ts +1 -0
- package/dist/commands/project/create.js +13 -5
- package/dist/commands/project/delete.d.ts +1 -0
- package/dist/commands/project/delete.js +14 -28
- package/dist/commands/project/index.d.ts +1 -0
- package/dist/commands/project/index.js +0 -5
- package/dist/commands/project/list.d.ts +2 -0
- package/dist/commands/project/list.js +21 -3
- package/dist/commands/project/spec.d.ts +1 -0
- package/dist/commands/project/spec.js +17 -23
- package/dist/commands/project/unarchive.d.ts +2 -0
- package/dist/commands/project/unarchive.js +21 -2
- package/dist/commands/project/view.d.ts +1 -0
- package/dist/commands/project/view.js +34 -22
- package/dist/commands/repo/add.d.ts +2 -0
- package/dist/commands/repo/add.js +44 -1
- package/dist/commands/repo/index.d.ts +1 -0
- package/dist/commands/repo/index.js +20 -38
- package/dist/commands/repo/list.d.ts +2 -0
- package/dist/commands/repo/remove.d.ts +1 -0
- package/dist/commands/repo/remove.js +45 -63
- package/dist/commands/repo/view.d.ts +2 -0
- package/dist/commands/repo/view.js +30 -5
- package/dist/commands/roadmap/add-project.d.ts +1 -0
- package/dist/commands/roadmap/create.d.ts +1 -0
- package/dist/commands/roadmap/delete.d.ts +1 -0
- package/dist/commands/roadmap/generate.d.ts +1 -0
- package/dist/commands/roadmap/index.d.ts +1 -0
- package/dist/commands/roadmap/list.d.ts +2 -0
- package/dist/commands/roadmap/remove-project.d.ts +1 -0
- package/dist/commands/roadmap/reorder.d.ts +1 -0
- package/dist/commands/roadmap/update.d.ts +1 -0
- package/dist/commands/roadmap/view.d.ts +1 -0
- package/dist/commands/session/attach.d.ts +1 -0
- package/dist/commands/session/index.d.ts +1 -0
- package/dist/commands/session/index.js +8 -25
- package/dist/commands/session/list.d.ts +2 -0
- package/dist/commands/spec/create.d.ts +1 -1
- package/dist/commands/spec/create.js +64 -65
- package/dist/commands/spec/index.d.ts +1 -0
- package/dist/commands/spec/index.js +36 -22
- package/dist/commands/spec/link/depends.d.ts +1 -0
- package/dist/commands/spec/link/depends.js +6 -6
- package/dist/commands/spec/link/duplicates.d.ts +1 -0
- package/dist/commands/spec/link/duplicates.js +6 -6
- package/dist/commands/spec/link/index.d.ts +2 -1
- package/dist/commands/spec/link/index.js +0 -4
- package/dist/commands/spec/link/relates.d.ts +1 -0
- package/dist/commands/spec/link/relates.js +6 -6
- package/dist/commands/spec/link/remove.d.ts +2 -1
- package/dist/commands/spec/link/remove.js +6 -6
- package/dist/commands/spec/list.d.ts +2 -0
- package/dist/commands/spec/list.js +25 -0
- package/dist/commands/spec/plan.d.ts +2 -1
- package/dist/commands/spec/plan.js +19 -26
- package/dist/commands/spec/ticket.d.ts +2 -1
- package/dist/commands/spec/ticket.js +48 -34
- package/dist/commands/spec/view.d.ts +2 -1
- package/dist/commands/spec/view.js +25 -16
- package/dist/commands/status/create.d.ts +1 -1
- package/dist/commands/status/create.js +80 -64
- package/dist/commands/status/delete.d.ts +2 -1
- package/dist/commands/status/delete.js +26 -22
- package/dist/commands/status/index.d.ts +1 -0
- package/dist/commands/status/index.js +26 -19
- package/dist/commands/status/list.d.ts +1 -0
- package/dist/commands/status/list.js +12 -7
- package/dist/commands/status/move.d.ts +2 -1
- package/dist/commands/status/move.js +62 -61
- package/dist/commands/status/update.d.ts +2 -2
- package/dist/commands/status/update.js +110 -77
- package/dist/commands/template/delete.d.ts +1 -0
- package/dist/commands/template/delete.js +47 -48
- package/dist/commands/template/index.d.ts +1 -0
- package/dist/commands/template/index.js +26 -33
- package/dist/commands/template/list.d.ts +1 -0
- package/dist/commands/template/phase/create.d.ts +1 -0
- package/dist/commands/template/phase/create.js +6 -0
- package/dist/commands/template/phase/index.d.ts +1 -0
- package/dist/commands/template/phase/index.js +27 -26
- package/dist/commands/template/phase/update.d.ts +1 -0
- package/dist/commands/template/phase/update.js +6 -0
- package/dist/commands/template/ticket/index.d.ts +1 -0
- package/dist/commands/template/ticket/index.js +27 -26
- package/dist/commands/template/ticket/save.d.ts +1 -0
- package/dist/commands/template/ticket/save.js +6 -0
- package/dist/commands/terminal/title.d.ts +26 -0
- package/dist/commands/terminal/title.js +37 -3
- package/dist/commands/ticket/bulk.d.ts +1 -0
- package/dist/commands/ticket/complete.d.ts +1 -0
- package/dist/commands/ticket/complete.js +18 -14
- package/dist/commands/ticket/create.d.ts +1 -0
- package/dist/commands/ticket/create.js +45 -41
- package/dist/commands/ticket/delete.d.ts +1 -0
- package/dist/commands/ticket/delete.js +1 -1
- package/dist/commands/ticket/edit.d.ts +1 -0
- package/dist/commands/ticket/edit.js +1 -1
- package/dist/commands/ticket/epic.d.ts +1 -0
- package/dist/commands/ticket/epic.js +2 -2
- package/dist/commands/ticket/index.d.ts +1 -0
- package/dist/commands/ticket/link/block.d.ts +1 -0
- package/dist/commands/ticket/link/block.js +1 -1
- package/dist/commands/ticket/link/duplicates.d.ts +1 -0
- package/dist/commands/ticket/link/duplicates.js +1 -1
- package/dist/commands/ticket/link/index.d.ts +1 -0
- package/dist/commands/ticket/link/index.js +9 -8
- package/dist/commands/ticket/link/relates.d.ts +1 -0
- package/dist/commands/ticket/link/relates.js +1 -1
- package/dist/commands/ticket/link/remove.d.ts +1 -0
- package/dist/commands/ticket/link/remove.js +1 -1
- package/dist/commands/ticket/list.d.ts +2 -0
- package/dist/commands/ticket/move.d.ts +1 -0
- package/dist/commands/ticket/move.js +27 -19
- package/dist/commands/ticket/project.d.ts +1 -0
- package/dist/commands/ticket/project.js +3 -3
- package/dist/commands/ticket/reassign.d.ts +1 -0
- package/dist/commands/ticket/reassign.js +1 -1
- package/dist/commands/ticket/spec.d.ts +1 -0
- package/dist/commands/ticket/spec.js +3 -3
- package/dist/commands/ticket/status.d.ts +1 -0
- package/dist/commands/ticket/status.js +1 -1
- package/dist/commands/ticket/template/apply.d.ts +1 -0
- package/dist/commands/ticket/template/create.d.ts +2 -0
- package/dist/commands/ticket/template/delete.d.ts +1 -0
- package/dist/commands/ticket/template/index.d.ts +1 -0
- package/dist/commands/ticket/template/list.d.ts +1 -0
- package/dist/commands/ticket/template/save.d.ts +2 -0
- package/dist/commands/ticket/update.d.ts +1 -0
- package/dist/commands/ticket/update.js +1 -1
- package/dist/commands/ticket/view.d.ts +1 -0
- package/dist/commands/ticket/view.js +1 -1
- package/dist/commands/work/complete.d.ts +1 -0
- package/dist/commands/work/index.d.ts +1 -0
- package/dist/commands/work/ready.d.ts +1 -0
- package/dist/commands/work/revise.d.ts +1 -0
- package/dist/commands/work/spawn-all.d.ts +2 -0
- package/dist/commands/work/spawn-all.js +11 -4
- package/dist/commands/work/spawn.d.ts +1 -0
- package/dist/commands/work/spawn.js +261 -166
- package/dist/commands/work/start.d.ts +1 -0
- package/dist/commands/work/start.js +270 -189
- package/dist/commands/work/watch.d.ts +1 -0
- package/dist/commands/work/watch.js +63 -58
- package/dist/commands/workflow/create.d.ts +1 -0
- package/dist/commands/workflow/create.js +2 -4
- package/dist/commands/workflow/delete.d.ts +1 -0
- package/dist/commands/workflow/delete.js +21 -33
- package/dist/commands/workflow/index.d.ts +1 -0
- package/dist/commands/workflow/list.d.ts +1 -0
- package/dist/commands/workflow/list.js +3 -6
- package/dist/commands/workflow/switch.d.ts +2 -0
- package/dist/commands/workflow/switch.js +46 -21
- package/dist/commands/workflow/view.d.ts +1 -0
- package/dist/commands/workflow/view.js +18 -27
- package/dist/commands/workspace/remove.d.ts +2 -2
- package/dist/commands/workspace/remove.js +16 -21
- package/dist/commands/workspace/use.d.ts +2 -2
- package/dist/commands/workspace/use.js +12 -18
- package/dist/lib/agents/commands.d.ts +1 -1
- package/dist/lib/agents/commands.js +4 -4
- package/dist/lib/database/drizzle-schema.d.ts +5009 -0
- package/dist/lib/database/drizzle-schema.js +699 -0
- package/dist/lib/database/drizzle.d.ts +29 -0
- package/dist/lib/database/drizzle.js +37 -0
- package/dist/lib/database/index.d.ts +1 -0
- package/dist/lib/database/index.js +1 -1
- package/dist/lib/execution/config.d.ts +6 -0
- package/dist/lib/execution/config.js +31 -13
- package/dist/lib/execution/devcontainer.js +13 -7
- package/dist/lib/execution/runners.js +24 -7
- package/dist/lib/execution/spawner.js +19 -0
- package/dist/lib/flags/index.d.ts +4 -0
- package/dist/lib/flags/index.js +4 -0
- package/dist/lib/flags/resolver.d.ts +224 -0
- package/dist/lib/flags/resolver.js +313 -0
- package/dist/lib/pmo/base-command.d.ts +53 -3
- package/dist/lib/pmo/base-command.js +92 -13
- package/dist/lib/pmo/find-pmo.d.ts +1 -1
- package/dist/lib/pmo/find-pmo.js +4 -4
- package/dist/lib/pmo/index.d.ts +1 -1
- package/dist/lib/pmo/index.js +1 -1
- package/dist/lib/pmo/storage/helpers.js +2 -1
- package/dist/lib/pmo/storage/index.d.ts +9 -0
- package/dist/lib/pmo/storage/index.js +14 -0
- package/dist/lib/pmo/storage/projects.d.ts +28 -13
- package/dist/lib/pmo/storage/projects.js +110 -34
- package/dist/lib/pmo/storage/roadmaps.d.ts +2 -0
- package/dist/lib/pmo/storage/roadmaps.js +182 -111
- package/dist/lib/pmo/storage/specs.js +13 -16
- package/dist/lib/pmo/storage/subtasks.js +17 -2
- package/dist/lib/pmo/storage/tickets.d.ts +12 -2
- package/dist/lib/pmo/storage/tickets.js +63 -5
- package/dist/lib/pmo/storage/types.d.ts +7 -3
- package/dist/lib/pmo/storage/views.d.ts +12 -1
- package/dist/lib/pmo/storage/views.js +61 -6
- package/dist/lib/prompt-command.d.ts +90 -0
- package/dist/lib/prompt-command.js +102 -0
- package/dist/lib/prompt-json.d.ts +34 -4
- package/dist/lib/prompt-json.js +35 -3
- package/dist/lib/repos/index.js +15 -15
- package/dist/lib/workspace.d.ts +4 -3
- package/dist/lib/workspace.js +3 -3
- package/oclif.manifest.json +4610 -2997
- package/package.json +13 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Flags, Args } from '@oclif/core';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
|
-
import inquirer from 'inquirer';
|
|
5
4
|
import { PMOCommand, pmoBaseFlags, autoExportToBoard } from '../../lib/pmo/index.js';
|
|
6
5
|
import { styles } from '../../lib/styles.js';
|
|
7
|
-
import { shouldOutputJson,
|
|
6
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
7
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
8
8
|
export default class SpecTicket extends PMOCommand {
|
|
9
9
|
static description = 'Assign a ticket to a spec document';
|
|
10
10
|
static examples = [
|
|
@@ -23,10 +23,6 @@ export default class SpecTicket extends PMOCommand {
|
|
|
23
23
|
};
|
|
24
24
|
static flags = {
|
|
25
25
|
...pmoBaseFlags,
|
|
26
|
-
json: Flags.boolean({
|
|
27
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
28
|
-
default: false,
|
|
29
|
-
}),
|
|
30
26
|
ticket: Flags.string({
|
|
31
27
|
char: 't',
|
|
32
28
|
description: 'Ticket ID',
|
|
@@ -38,10 +34,16 @@ export default class SpecTicket extends PMOCommand {
|
|
|
38
34
|
};
|
|
39
35
|
async execute() {
|
|
40
36
|
const { args, flags } = await this.parse(SpecTicket);
|
|
41
|
-
// This command requires project context
|
|
42
|
-
const projectId = await this.requireProject();
|
|
43
37
|
// Check if JSON output mode is active
|
|
44
38
|
const jsonMode = shouldOutputJson(flags);
|
|
39
|
+
// This command requires project context (with JSON mode support)
|
|
40
|
+
const projectId = await this.requireProject({
|
|
41
|
+
jsonMode: jsonMode ? {
|
|
42
|
+
flags,
|
|
43
|
+
commandName: 'spec ticket',
|
|
44
|
+
baseCommand: 'prlt spec ticket',
|
|
45
|
+
} : undefined,
|
|
46
|
+
});
|
|
45
47
|
// Helper to handle errors in JSON mode
|
|
46
48
|
const handleError = (code, message) => {
|
|
47
49
|
if (jsonMode) {
|
|
@@ -57,19 +59,25 @@ export default class SpecTicket extends PMOCommand {
|
|
|
57
59
|
if (tickets.length === 0) {
|
|
58
60
|
return handleError('NO_TICKETS', 'No tickets found. Create one first with: prlt ticket create');
|
|
59
61
|
}
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
// Use FlagResolver for ticket selection
|
|
63
|
+
const ticketResolver = new FlagResolver({
|
|
64
|
+
commandName: 'spec ticket',
|
|
65
|
+
baseCommand: 'prlt spec ticket',
|
|
66
|
+
jsonMode,
|
|
67
|
+
flags: { ticket: flags.ticket },
|
|
68
|
+
context: { projectId },
|
|
69
|
+
});
|
|
70
|
+
ticketResolver.addPrompt({
|
|
71
|
+
flagName: 'ticket',
|
|
72
|
+
type: 'list',
|
|
73
|
+
message: 'Select ticket to link:',
|
|
74
|
+
choices: () => tickets.map(t => ({
|
|
75
|
+
name: `${t.id}: ${t.title}`,
|
|
76
|
+
value: t.id,
|
|
77
|
+
})),
|
|
78
|
+
});
|
|
79
|
+
const resolved = await ticketResolver.resolve();
|
|
80
|
+
ticketId = resolved.ticket;
|
|
73
81
|
}
|
|
74
82
|
if (!ticketId) {
|
|
75
83
|
return handleError('NO_TICKET_SELECTED', 'No ticket selected');
|
|
@@ -87,19 +95,25 @@ export default class SpecTicket extends PMOCommand {
|
|
|
87
95
|
if (specs.length === 0) {
|
|
88
96
|
return handleError('NO_SPECS', 'No specs found. Create one first with: prlt spec create');
|
|
89
97
|
}
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
// Use FlagResolver for spec selection
|
|
99
|
+
const specResolver = new FlagResolver({
|
|
100
|
+
commandName: 'spec ticket',
|
|
101
|
+
baseCommand: `prlt spec ticket --ticket "${ticketId}"`,
|
|
102
|
+
jsonMode,
|
|
103
|
+
flags: { spec: flags.spec },
|
|
104
|
+
context: { projectId, ticketId },
|
|
105
|
+
});
|
|
106
|
+
specResolver.addPrompt({
|
|
107
|
+
flagName: 'spec',
|
|
108
|
+
type: 'list',
|
|
109
|
+
message: 'Select spec to link:',
|
|
110
|
+
choices: () => specs.map(s => ({
|
|
111
|
+
name: `${s.name} (${s.status})`,
|
|
112
|
+
value: s.id,
|
|
113
|
+
})),
|
|
114
|
+
});
|
|
115
|
+
const resolved = await specResolver.resolve();
|
|
116
|
+
specId = resolved.spec;
|
|
103
117
|
}
|
|
104
118
|
if (!specId) {
|
|
105
119
|
this.error('No spec selected');
|
|
@@ -6,9 +6,10 @@ export default class SpecView extends PMOCommand {
|
|
|
6
6
|
spec: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
10
|
full: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
};
|
|
14
15
|
execute(): Promise<void>;
|
|
@@ -2,6 +2,7 @@ import { Flags, Args } from '@oclif/core';
|
|
|
2
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
3
|
import { styles } from '../../lib/styles.js';
|
|
4
4
|
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
5
6
|
export default class SpecView extends PMOCommand {
|
|
6
7
|
static description = 'View a spec and its linked tickets';
|
|
7
8
|
static examples = [
|
|
@@ -16,10 +17,6 @@ export default class SpecView extends PMOCommand {
|
|
|
16
17
|
};
|
|
17
18
|
static flags = {
|
|
18
19
|
...pmoBaseFlags,
|
|
19
|
-
json: Flags.boolean({
|
|
20
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
21
|
-
default: false,
|
|
22
|
-
}),
|
|
23
20
|
spec: Flags.string({
|
|
24
21
|
char: 's',
|
|
25
22
|
description: 'Spec ID',
|
|
@@ -32,10 +29,16 @@ export default class SpecView extends PMOCommand {
|
|
|
32
29
|
};
|
|
33
30
|
async execute() {
|
|
34
31
|
const { args, flags } = await this.parse(SpecView);
|
|
35
|
-
// This command requires project context for listing linked tickets
|
|
36
|
-
const projectId = await this.requireProject();
|
|
37
32
|
// Check if JSON output mode is active
|
|
38
33
|
const jsonMode = shouldOutputJson(flags);
|
|
34
|
+
// This command requires project context for listing linked tickets (with JSON mode support)
|
|
35
|
+
const projectId = await this.requireProject({
|
|
36
|
+
jsonMode: jsonMode ? {
|
|
37
|
+
flags,
|
|
38
|
+
commandName: 'spec view',
|
|
39
|
+
baseCommand: 'prlt spec view',
|
|
40
|
+
} : undefined,
|
|
41
|
+
});
|
|
39
42
|
// Helper to handle errors in JSON mode
|
|
40
43
|
const handleError = (code, message) => {
|
|
41
44
|
if (jsonMode) {
|
|
@@ -51,18 +54,24 @@ export default class SpecView extends PMOCommand {
|
|
|
51
54
|
if (specs.length === 0) {
|
|
52
55
|
return handleError('NO_SPECS', 'No specs found. Create one first with: prlt spec create');
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
// Use FlagResolver for spec selection
|
|
58
|
+
const resolver = new FlagResolver({
|
|
59
|
+
commandName: 'spec view',
|
|
60
|
+
baseCommand: 'prlt spec view',
|
|
61
|
+
jsonMode,
|
|
62
|
+
flags: { spec: flags.spec },
|
|
63
|
+
});
|
|
64
|
+
resolver.addPrompt({
|
|
65
|
+
flagName: 'spec',
|
|
66
|
+
type: 'list',
|
|
55
67
|
message: 'Select spec to view:',
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
jsonMode: jsonMode ? { flags, commandName: 'spec view' } : null,
|
|
68
|
+
choices: () => specs.map(s => ({
|
|
69
|
+
name: `${s.title} [${s.status}]${s.type ? ` (${s.type})` : ''}`,
|
|
70
|
+
value: s.id,
|
|
71
|
+
})),
|
|
61
72
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
specId = selected;
|
|
73
|
+
const resolved = await resolver.resolve();
|
|
74
|
+
specId = resolved.spec;
|
|
66
75
|
}
|
|
67
76
|
// Get the spec
|
|
68
77
|
const spec = await this.storage.getSpec(specId);
|
|
@@ -12,10 +12,10 @@ export default class StatusCreate extends PMOCommand {
|
|
|
12
12
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
};
|
|
18
19
|
execute(): Promise<void>;
|
|
19
|
-
private promptStatusData;
|
|
20
20
|
private getCategoryDescription;
|
|
21
21
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Flags, Args } from '@oclif/core';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
4
3
|
import { styles } from '../../lib/styles.js';
|
|
5
4
|
import { STATE_CATEGORY_ORDER } from '../../lib/pmo/types.js';
|
|
6
|
-
import {
|
|
5
|
+
import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
|
|
7
6
|
export default class StatusCreate extends PMOCommand {
|
|
8
7
|
static description = 'Create a new workflow status';
|
|
9
8
|
static examples = [
|
|
@@ -44,54 +43,93 @@ export default class StatusCreate extends PMOCommand {
|
|
|
44
43
|
description: 'Interactive mode',
|
|
45
44
|
default: false,
|
|
46
45
|
}),
|
|
47
|
-
json: Flags.boolean({
|
|
48
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
49
|
-
default: false,
|
|
50
|
-
}),
|
|
51
46
|
};
|
|
52
47
|
async execute() {
|
|
53
48
|
const { args, flags } = await this.parse(StatusCreate);
|
|
54
|
-
const projectId = await this.requireProject();
|
|
55
49
|
// Check if JSON output mode is active
|
|
56
50
|
const jsonMode = shouldOutputJson(flags);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
// This command requires project context - get projectId (with JSON mode support)
|
|
52
|
+
const projectId = await this.requireProject({
|
|
53
|
+
jsonMode: jsonMode ? {
|
|
54
|
+
flags,
|
|
55
|
+
commandName: 'status create',
|
|
56
|
+
baseCommand: 'prlt status create',
|
|
57
|
+
} : undefined,
|
|
58
|
+
});
|
|
59
|
+
// Determine initial name from args or flags
|
|
60
|
+
const initialName = args.name || flags.name;
|
|
61
|
+
// Create FlagResolver for prompts
|
|
62
|
+
const resolver = new FlagResolver({
|
|
63
|
+
commandName: 'status create',
|
|
64
|
+
baseCommand: 'prlt status create',
|
|
65
|
+
jsonMode,
|
|
66
|
+
flags: { ...flags, name: initialName, category: flags.category },
|
|
67
|
+
context: { projectId },
|
|
68
|
+
});
|
|
69
|
+
// Add name prompt
|
|
70
|
+
resolver.addPrompt({
|
|
71
|
+
flagName: 'name',
|
|
72
|
+
type: 'input',
|
|
73
|
+
message: 'Status name:',
|
|
74
|
+
default: initialName,
|
|
75
|
+
validate: (value) => value.length > 0 || 'Name is required',
|
|
76
|
+
when: (ctx) => !ctx.flags.name || flags.interactive,
|
|
77
|
+
});
|
|
78
|
+
// Add category prompt
|
|
79
|
+
resolver.addPrompt({
|
|
80
|
+
flagName: 'category',
|
|
81
|
+
type: 'list',
|
|
82
|
+
message: 'Category:',
|
|
83
|
+
choices: () => STATE_CATEGORY_ORDER.map(cat => ({
|
|
63
84
|
name: `${cat} - ${this.getCategoryDescription(cat)}`,
|
|
64
85
|
value: cat,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
command: `prlt status create --category ${cat} --machine`,
|
|
87
|
+
})),
|
|
88
|
+
default: flags.category || 'backlog',
|
|
89
|
+
when: (ctx) => !ctx.flags.category || flags.interactive,
|
|
90
|
+
});
|
|
91
|
+
// Add color prompt
|
|
92
|
+
resolver.addPrompt({
|
|
93
|
+
flagName: 'color',
|
|
94
|
+
type: 'input',
|
|
95
|
+
message: 'Color (hex, optional):',
|
|
96
|
+
default: flags.color,
|
|
97
|
+
validate: (value) => {
|
|
98
|
+
const v = value;
|
|
99
|
+
if (!v)
|
|
100
|
+
return true;
|
|
101
|
+
return /^#[0-9A-Fa-f]{6}$/.test(v) || 'Invalid hex color (e.g., #FF0000)';
|
|
102
|
+
},
|
|
103
|
+
when: (ctx) => ctx.flags.color === undefined || flags.interactive,
|
|
104
|
+
});
|
|
105
|
+
// Add description prompt
|
|
106
|
+
resolver.addPrompt({
|
|
107
|
+
flagName: 'description',
|
|
108
|
+
type: 'input',
|
|
109
|
+
message: 'Description (optional):',
|
|
110
|
+
default: flags.description,
|
|
111
|
+
when: (ctx) => ctx.flags.description === undefined || flags.interactive,
|
|
112
|
+
});
|
|
113
|
+
// Add default prompt
|
|
114
|
+
resolver.addPrompt({
|
|
115
|
+
flagName: 'default',
|
|
116
|
+
type: 'list',
|
|
117
|
+
message: 'Set as default status for new tickets?',
|
|
118
|
+
choices: () => [
|
|
119
|
+
{ name: 'No', value: false, command: 'prlt status create --json' },
|
|
120
|
+
{ name: 'Yes', value: true, command: 'prlt status create --default --json' },
|
|
121
|
+
],
|
|
122
|
+
default: flags.default || false,
|
|
123
|
+
when: (ctx) => ctx.flags.default === undefined || flags.interactive,
|
|
124
|
+
});
|
|
125
|
+
// Resolve all flags
|
|
126
|
+
const resolved = await resolver.resolve();
|
|
89
127
|
const status = await this.storage.createStatus(projectId, {
|
|
90
|
-
name:
|
|
91
|
-
category:
|
|
92
|
-
color:
|
|
93
|
-
description:
|
|
94
|
-
isDefault:
|
|
128
|
+
name: resolved.name,
|
|
129
|
+
category: resolved.category,
|
|
130
|
+
color: resolved.color,
|
|
131
|
+
description: resolved.description,
|
|
132
|
+
isDefault: resolved.default,
|
|
95
133
|
});
|
|
96
134
|
const projectName = await this.getProjectName(projectId);
|
|
97
135
|
this.log(styles.success(`\nCreated status "${styles.emphasis(status.name)}"`));
|
|
@@ -104,28 +142,6 @@ export default class StatusCreate extends PMOCommand {
|
|
|
104
142
|
this.log(styles.muted(` Default: yes`));
|
|
105
143
|
}
|
|
106
144
|
}
|
|
107
|
-
async promptStatusData(fields) {
|
|
108
|
-
// Build inquirer prompts from fields, adding validators
|
|
109
|
-
const answers = await inquirer.prompt(fields.map(field => ({
|
|
110
|
-
...field,
|
|
111
|
-
validate: field.name === 'name'
|
|
112
|
-
? ((input) => input.length > 0 || 'Name is required')
|
|
113
|
-
: field.name === 'color'
|
|
114
|
-
? ((input) => {
|
|
115
|
-
if (!input)
|
|
116
|
-
return true;
|
|
117
|
-
return /^#[0-9A-Fa-f]{6}$/.test(input) || 'Invalid hex color (e.g., #FF0000)';
|
|
118
|
-
})
|
|
119
|
-
: undefined,
|
|
120
|
-
})));
|
|
121
|
-
return {
|
|
122
|
-
name: answers.name,
|
|
123
|
-
category: answers.category,
|
|
124
|
-
color: answers.color || undefined,
|
|
125
|
-
description: answers.description || undefined,
|
|
126
|
-
isDefault: answers.isDefault,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
145
|
getCategoryDescription(category) {
|
|
130
146
|
const descriptions = {
|
|
131
147
|
triage: 'Inbox - needs review before entering workflow',
|
|
@@ -6,8 +6,9 @@ export default class StatusDelete extends PMOCommand {
|
|
|
6
6
|
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
execute(): Promise<void>;
|
|
13
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Flags, Args } from '@oclif/core';
|
|
2
|
-
import
|
|
3
|
-
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
import { PMOCommand, machineOutputFlags } from '../../lib/pmo/index.js';
|
|
4
3
|
import { styles } from '../../lib/styles.js';
|
|
5
|
-
import {
|
|
4
|
+
import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
|
|
5
|
+
import { outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
6
6
|
export default class StatusDelete extends PMOCommand {
|
|
7
7
|
static description = 'Delete a workflow status';
|
|
8
8
|
static examples = [
|
|
@@ -16,10 +16,7 @@ export default class StatusDelete extends PMOCommand {
|
|
|
16
16
|
}),
|
|
17
17
|
};
|
|
18
18
|
static flags = {
|
|
19
|
-
|
|
20
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
21
|
-
default: false,
|
|
22
|
-
}),
|
|
19
|
+
...machineOutputFlags,
|
|
23
20
|
force: Flags.boolean({
|
|
24
21
|
char: 'f',
|
|
25
22
|
description: 'Skip confirmation prompt',
|
|
@@ -43,22 +40,29 @@ export default class StatusDelete extends PMOCommand {
|
|
|
43
40
|
if (!existing) {
|
|
44
41
|
return handleError('STATUS_NOT_FOUND', `Status not found: ${args.id}`);
|
|
45
42
|
}
|
|
46
|
-
// Confirm deletion
|
|
43
|
+
// Confirm deletion if not forced
|
|
47
44
|
if (!flags.force) {
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
// Create FlagResolver for confirmation
|
|
46
|
+
const resolver = new FlagResolver({
|
|
47
|
+
commandName: 'status delete',
|
|
48
|
+
baseCommand: `prlt status delete ${args.id}`,
|
|
49
|
+
jsonMode,
|
|
50
|
+
flags: { ...flags, confirm: flags.force ? true : undefined },
|
|
51
|
+
context: { statusId: args.id, existing },
|
|
52
|
+
});
|
|
53
|
+
// Add confirmation prompt (use list instead of confirm per CLAUDE.md guidelines)
|
|
54
|
+
resolver.addPrompt({
|
|
55
|
+
flagName: 'confirm',
|
|
56
|
+
type: 'list',
|
|
57
|
+
message: `Delete status "${existing.name}" (${existing.category})?`,
|
|
58
|
+
choices: () => [
|
|
59
|
+
{ name: 'No, cancel', value: false, command: '' },
|
|
60
|
+
{ name: 'Yes, delete', value: true, command: `prlt status delete ${args.id} --force --machine` },
|
|
61
|
+
],
|
|
62
|
+
when: (ctx) => ctx.flags.confirm === undefined,
|
|
63
|
+
});
|
|
64
|
+
const resolved = await resolver.resolve();
|
|
65
|
+
if (!resolved.confirm) {
|
|
62
66
|
this.log(styles.muted('Cancelled'));
|
|
63
67
|
return;
|
|
64
68
|
}
|
|
@@ -4,6 +4,7 @@ export default class Status extends PMOCommand {
|
|
|
4
4
|
static aliases: string[];
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
1
|
import inquirer from 'inquirer';
|
|
3
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
4
|
-
import { shouldOutputJson } from '../../lib/
|
|
3
|
+
import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
|
|
5
4
|
export default class Status extends PMOCommand {
|
|
6
5
|
static description = 'Interactive menu for workflow status operations';
|
|
7
6
|
static aliases = ['statuses'];
|
|
@@ -10,10 +9,6 @@ export default class Status extends PMOCommand {
|
|
|
10
9
|
];
|
|
11
10
|
static flags = {
|
|
12
11
|
...pmoBaseFlags,
|
|
13
|
-
json: Flags.boolean({
|
|
14
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
15
|
-
default: false,
|
|
16
|
-
}),
|
|
17
12
|
};
|
|
18
13
|
getPMOOptions() {
|
|
19
14
|
return { promptIfMultiple: false };
|
|
@@ -25,22 +20,34 @@ export default class Status extends PMOCommand {
|
|
|
25
20
|
// Define choices once, use for both JSON and interactive modes
|
|
26
21
|
// Each choice includes the full command for AI agents to execute
|
|
27
22
|
const menuChoices = [
|
|
28
|
-
{ id: 'list', name: 'List all statuses', command: 'prlt status list --
|
|
29
|
-
{ id: 'create', name: 'Create new status', command: 'prlt status create --
|
|
30
|
-
{ id: 'update', name: 'Update status', command: 'prlt status update --
|
|
31
|
-
{ id: 'move', name: 'Move status (change order)', command: 'prlt status move --
|
|
32
|
-
{ id: 'delete', name: 'Delete status', command: 'prlt status delete --
|
|
23
|
+
{ id: 'list', name: 'List all statuses', command: 'prlt status list --machine' },
|
|
24
|
+
{ id: 'create', name: 'Create new status', command: 'prlt status create --machine' },
|
|
25
|
+
{ id: 'update', name: 'Update status', command: 'prlt status update --machine' },
|
|
26
|
+
{ id: 'move', name: 'Move status (change order)', command: 'prlt status move --machine' },
|
|
27
|
+
{ id: 'delete', name: 'Delete status', command: 'prlt status delete --machine' },
|
|
33
28
|
{ id: 'cancel', name: 'Cancel', command: '' },
|
|
34
29
|
];
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
getCommand: (c) => c.command,
|
|
42
|
-
jsonMode: jsonMode ? { flags, commandName: 'status' } : null,
|
|
30
|
+
// Create FlagResolver for menu selection
|
|
31
|
+
const resolver = new FlagResolver({
|
|
32
|
+
commandName: 'status',
|
|
33
|
+
baseCommand: 'prlt status',
|
|
34
|
+
jsonMode,
|
|
35
|
+
flags,
|
|
43
36
|
});
|
|
37
|
+
// Add menu prompt
|
|
38
|
+
resolver.addPrompt({
|
|
39
|
+
flagName: 'action',
|
|
40
|
+
type: 'list',
|
|
41
|
+
message: '📊 Workflow Statuses - What would you like to do?',
|
|
42
|
+
choices: () => menuChoices.map(c => ({
|
|
43
|
+
name: c.name,
|
|
44
|
+
value: c.id,
|
|
45
|
+
command: c.command,
|
|
46
|
+
})),
|
|
47
|
+
when: (ctx) => !ctx.flags.action,
|
|
48
|
+
});
|
|
49
|
+
const resolved = await resolver.resolve();
|
|
50
|
+
const action = resolved.action;
|
|
44
51
|
if (action === 'cancel' || !action) {
|
|
45
52
|
return;
|
|
46
53
|
}
|
|
@@ -4,6 +4,7 @@ export default class StatusList extends PMOCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
category: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -2,6 +2,7 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
3
|
import { styles } from '../../lib/styles.js';
|
|
4
4
|
import { STATE_CATEGORY_ORDER } from '../../lib/pmo/types.js';
|
|
5
|
+
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
5
6
|
export default class StatusList extends PMOCommand {
|
|
6
7
|
static description = 'List all workflow statuses for a project';
|
|
7
8
|
static examples = [
|
|
@@ -16,22 +17,26 @@ export default class StatusList extends PMOCommand {
|
|
|
16
17
|
description: 'Filter by category',
|
|
17
18
|
options: ['backlog', 'unstarted', 'started', 'completed', 'canceled'],
|
|
18
19
|
}),
|
|
19
|
-
json: Flags.boolean({
|
|
20
|
-
description: 'Output as JSON',
|
|
21
|
-
default: false,
|
|
22
|
-
}),
|
|
23
20
|
};
|
|
24
21
|
async execute() {
|
|
25
22
|
const { flags } = await this.parse(StatusList);
|
|
26
|
-
//
|
|
27
|
-
const
|
|
23
|
+
// Check if JSON output mode is active
|
|
24
|
+
const jsonMode = shouldOutputJson(flags);
|
|
25
|
+
// This command requires project context - get projectId (with JSON mode support)
|
|
26
|
+
const projectId = await this.requireProject({
|
|
27
|
+
jsonMode: jsonMode ? {
|
|
28
|
+
flags,
|
|
29
|
+
commandName: 'status list',
|
|
30
|
+
baseCommand: 'prlt status list',
|
|
31
|
+
} : undefined,
|
|
32
|
+
});
|
|
28
33
|
// Get the project's workflow ID
|
|
29
34
|
const project = await this.storage.getProject(projectId);
|
|
30
35
|
if (!project?.workflowId) {
|
|
31
36
|
this.error(`Project "${projectId}" has no workflow assigned.`);
|
|
32
37
|
}
|
|
33
38
|
const statuses = await this.storage.listStatuses(project.workflowId);
|
|
34
|
-
if (
|
|
39
|
+
if (jsonMode) {
|
|
35
40
|
this.log(JSON.stringify(statuses, null, 2));
|
|
36
41
|
return;
|
|
37
42
|
}
|
|
@@ -6,8 +6,9 @@ export default class StatusMove extends PMOCommand {
|
|
|
6
6
|
id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
position: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
};
|
|
13
14
|
execute(): Promise<void>;
|