@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
|
@@ -7,6 +7,7 @@ export default class TemplateList extends PMOCommand {
|
|
|
7
7
|
builtin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
custom: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
};
|
|
12
13
|
protected getPMOOptions(): {
|
|
@@ -7,6 +7,7 @@ export default class TemplatePhaseCreate extends Command {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
9
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
};
|
|
11
12
|
run(): Promise<void>;
|
|
12
13
|
}
|
|
@@ -16,6 +16,10 @@ export default class TemplatePhaseCreate extends Command {
|
|
|
16
16
|
char: 'd',
|
|
17
17
|
description: 'Template description',
|
|
18
18
|
}),
|
|
19
|
+
json: Flags.boolean({
|
|
20
|
+
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
21
|
+
default: false,
|
|
22
|
+
}),
|
|
19
23
|
};
|
|
20
24
|
async run() {
|
|
21
25
|
const { args, flags } = await this.parse(TemplatePhaseCreate);
|
|
@@ -24,6 +28,8 @@ export default class TemplatePhaseCreate extends Command {
|
|
|
24
28
|
cmdArgs.push(args.name);
|
|
25
29
|
if (flags.description)
|
|
26
30
|
cmdArgs.push('--description', flags.description);
|
|
31
|
+
if (flags.json)
|
|
32
|
+
cmdArgs.push('--json');
|
|
27
33
|
await this.config.runCommand('phase:template:create', cmdArgs);
|
|
28
34
|
}
|
|
29
35
|
}
|
|
@@ -4,6 +4,7 @@ export default class TemplatePhase extends Command {
|
|
|
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
|
};
|
|
9
10
|
run(): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Command
|
|
2
|
-
import inquirer from 'inquirer';
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
3
2
|
import { styles } from '../../../lib/styles.js';
|
|
4
|
-
import {
|
|
3
|
+
import { FlagResolver, shouldOutputJson } from '../../../lib/flags/index.js';
|
|
4
|
+
import { machineOutputFlags } from '../../../lib/pmo/index.js';
|
|
5
5
|
export default class TemplatePhase extends Command {
|
|
6
6
|
static description = 'Manage phase templates (project lifecycle phases)';
|
|
7
7
|
static aliases = ['template:phases'];
|
|
@@ -12,36 +12,37 @@ export default class TemplatePhase extends Command {
|
|
|
12
12
|
'<%= config.bin %> <%= command.id %> create "My Phases"',
|
|
13
13
|
];
|
|
14
14
|
static flags = {
|
|
15
|
-
|
|
16
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
17
|
-
default: false,
|
|
18
|
-
}),
|
|
15
|
+
...machineOutputFlags,
|
|
19
16
|
};
|
|
20
17
|
async run() {
|
|
21
18
|
const { flags } = await this.parse(TemplatePhase);
|
|
22
19
|
const jsonMode = shouldOutputJson(flags);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
// Create resolver for action selection
|
|
21
|
+
const resolver = new FlagResolver({
|
|
22
|
+
commandName: 'template phase',
|
|
23
|
+
baseCommand: 'prlt template phase',
|
|
24
|
+
jsonMode,
|
|
25
|
+
flags: {},
|
|
26
|
+
});
|
|
27
|
+
resolver.addPrompt({
|
|
28
|
+
flagName: 'action',
|
|
29
|
+
type: 'list',
|
|
30
|
+
message: 'What would you like to do?',
|
|
31
|
+
choices: () => [
|
|
32
|
+
{ name: 'List phase templates', value: 'list', command: 'prlt template phase list --json' },
|
|
33
|
+
{ name: 'Apply a phase template to project', value: 'apply', command: 'prlt phase template apply --json' },
|
|
34
|
+
{ name: 'Create a new phase template', value: 'create', command: 'prlt phase template create --json' },
|
|
35
|
+
{ name: 'Update a phase template', value: 'update', command: 'prlt phase template update --json' },
|
|
36
|
+
{ name: 'Delete a phase template', value: 'delete', command: 'prlt phase template delete --json' },
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
// In JSON mode, this outputs the prompt and exits
|
|
40
|
+
const resolved = await resolver.resolve();
|
|
41
|
+
// Only reached in interactive mode
|
|
35
42
|
this.log('');
|
|
36
43
|
this.log(styles.header('Phase Templates'));
|
|
37
44
|
this.log('');
|
|
38
|
-
|
|
39
|
-
type: 'list',
|
|
40
|
-
name: 'action',
|
|
41
|
-
message,
|
|
42
|
-
choices: menuChoices.map(c => ({ name: c.name, value: c.value })),
|
|
43
|
-
}]);
|
|
44
|
-
switch (action) {
|
|
45
|
+
switch (resolved.action) {
|
|
45
46
|
case 'list':
|
|
46
47
|
await this.config.runCommand('template:phase:list', []);
|
|
47
48
|
break;
|
|
@@ -8,6 +8,7 @@ export default class TemplatePhaseUpdate extends Command {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
run(): Promise<void>;
|
|
13
14
|
}
|
|
@@ -20,6 +20,10 @@ export default class TemplatePhaseUpdate extends Command {
|
|
|
20
20
|
char: 'd',
|
|
21
21
|
description: 'New template description',
|
|
22
22
|
}),
|
|
23
|
+
json: Flags.boolean({
|
|
24
|
+
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
25
|
+
default: false,
|
|
26
|
+
}),
|
|
23
27
|
};
|
|
24
28
|
async run() {
|
|
25
29
|
const { args, flags } = await this.parse(TemplatePhaseUpdate);
|
|
@@ -30,6 +34,8 @@ export default class TemplatePhaseUpdate extends Command {
|
|
|
30
34
|
cmdArgs.push('--name', flags.name);
|
|
31
35
|
if (flags.description)
|
|
32
36
|
cmdArgs.push('--description', flags.description);
|
|
37
|
+
if (flags.json)
|
|
38
|
+
cmdArgs.push('--json');
|
|
33
39
|
await this.config.runCommand('phase:template:update', cmdArgs);
|
|
34
40
|
}
|
|
35
41
|
}
|
|
@@ -4,6 +4,7 @@ export default class TemplateTicket extends Command {
|
|
|
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
|
};
|
|
9
10
|
run(): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Command
|
|
2
|
-
import inquirer from 'inquirer';
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
3
2
|
import { styles } from '../../../lib/styles.js';
|
|
4
|
-
import {
|
|
3
|
+
import { FlagResolver, shouldOutputJson } from '../../../lib/flags/index.js';
|
|
4
|
+
import { machineOutputFlags } from '../../../lib/pmo/index.js';
|
|
5
5
|
export default class TemplateTicket extends Command {
|
|
6
6
|
static description = 'Manage ticket templates (for creating tickets from templates)';
|
|
7
7
|
static aliases = ['template:tickets'];
|
|
@@ -12,36 +12,37 @@ export default class TemplateTicket extends Command {
|
|
|
12
12
|
'<%= config.bin %> <%= command.id %> save TKT-001 "My Template"',
|
|
13
13
|
];
|
|
14
14
|
static flags = {
|
|
15
|
-
|
|
16
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
17
|
-
default: false,
|
|
18
|
-
}),
|
|
15
|
+
...machineOutputFlags,
|
|
19
16
|
};
|
|
20
17
|
async run() {
|
|
21
18
|
const { flags } = await this.parse(TemplateTicket);
|
|
22
19
|
const jsonMode = shouldOutputJson(flags);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
// Create resolver for action selection
|
|
21
|
+
const resolver = new FlagResolver({
|
|
22
|
+
commandName: 'template ticket',
|
|
23
|
+
baseCommand: 'prlt template ticket',
|
|
24
|
+
jsonMode,
|
|
25
|
+
flags: {},
|
|
26
|
+
});
|
|
27
|
+
resolver.addPrompt({
|
|
28
|
+
flagName: 'action',
|
|
29
|
+
type: 'list',
|
|
30
|
+
message: 'What would you like to do?',
|
|
31
|
+
choices: () => [
|
|
32
|
+
{ name: 'List ticket templates', value: 'list', command: 'prlt template ticket list --json' },
|
|
33
|
+
{ name: 'Create new template', value: 'create', command: 'prlt ticket template create --json' },
|
|
34
|
+
{ name: 'Create ticket from template', value: 'apply', command: 'prlt ticket template apply --json' },
|
|
35
|
+
{ name: 'Save ticket as template', value: 'save', command: 'prlt ticket template save --json' },
|
|
36
|
+
{ name: 'Delete ticket template', value: 'delete', command: 'prlt ticket template delete --json' },
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
// In JSON mode, this outputs the prompt and exits
|
|
40
|
+
const resolved = await resolver.resolve();
|
|
41
|
+
// Only reached in interactive mode
|
|
35
42
|
this.log('');
|
|
36
43
|
this.log(styles.header('Ticket Templates'));
|
|
37
44
|
this.log('');
|
|
38
|
-
|
|
39
|
-
type: 'list',
|
|
40
|
-
name: 'action',
|
|
41
|
-
message,
|
|
42
|
-
choices: menuChoices.map(c => ({ name: c.name, value: c.value })),
|
|
43
|
-
}]);
|
|
44
|
-
switch (action) {
|
|
45
|
+
switch (resolved.action) {
|
|
45
46
|
case 'list':
|
|
46
47
|
await this.config.runCommand('template:ticket:list', []);
|
|
47
48
|
break;
|
|
@@ -8,6 +8,7 @@ export default class TemplateTicketSave extends Command {
|
|
|
8
8
|
};
|
|
9
9
|
static flags: {
|
|
10
10
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
run(): Promise<void>;
|
|
13
14
|
}
|
|
@@ -20,6 +20,10 @@ export default class TemplateTicketSave extends Command {
|
|
|
20
20
|
char: 'd',
|
|
21
21
|
description: 'Template description',
|
|
22
22
|
}),
|
|
23
|
+
json: Flags.boolean({
|
|
24
|
+
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
25
|
+
default: false,
|
|
26
|
+
}),
|
|
23
27
|
};
|
|
24
28
|
async run() {
|
|
25
29
|
const { args, flags } = await this.parse(TemplateTicketSave);
|
|
@@ -30,6 +34,8 @@ export default class TemplateTicketSave extends Command {
|
|
|
30
34
|
cmdArgs.push(args.name);
|
|
31
35
|
if (flags.description)
|
|
32
36
|
cmdArgs.push('--description', flags.description);
|
|
37
|
+
if (flags.json)
|
|
38
|
+
cmdArgs.push('--json');
|
|
33
39
|
await this.config.runCommand('ticket:template:save', cmdArgs);
|
|
34
40
|
}
|
|
35
41
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
+
import { type JsonFlags } from '../../lib/prompt-json.js';
|
|
2
3
|
export default class TerminalTitle extends Command {
|
|
3
4
|
static description: string;
|
|
4
5
|
static examples: string[];
|
|
@@ -6,7 +7,32 @@ export default class TerminalTitle extends Command {
|
|
|
6
7
|
title: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
8
|
};
|
|
8
9
|
static flags: {
|
|
10
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
12
|
reset: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Prompt wrapper - drop-in replacement for inquirer.prompt with JSON mode support.
|
|
16
|
+
* Matches the pattern from PMOCommand.prompt().
|
|
17
|
+
*
|
|
18
|
+
* In JSON mode: outputs prompt config as JSON and exits
|
|
19
|
+
* In interactive mode: shows normal inquirer prompt
|
|
20
|
+
*/
|
|
21
|
+
protected prompt<T extends Record<string, unknown>>(questions: Array<{
|
|
22
|
+
type: string;
|
|
23
|
+
name: string;
|
|
24
|
+
message: string;
|
|
25
|
+
choices?: Array<string | {
|
|
26
|
+
name: string;
|
|
27
|
+
value: unknown;
|
|
28
|
+
disabled?: boolean | string;
|
|
29
|
+
command?: string;
|
|
30
|
+
} | unknown>;
|
|
31
|
+
default?: unknown;
|
|
32
|
+
validate?: (input: unknown) => boolean | string;
|
|
33
|
+
}>, jsonModeConfig?: {
|
|
34
|
+
flags: JsonFlags & Record<string, unknown>;
|
|
35
|
+
commandName: string;
|
|
36
|
+
} | null): Promise<T>;
|
|
11
37
|
run(): Promise<void>;
|
|
12
38
|
}
|
|
@@ -2,12 +2,15 @@ import { Args, Command, Flags } from '@oclif/core';
|
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { setTerminalTitle, resetTerminalTitle } from '../../lib/terminal.js';
|
|
4
4
|
import { styles } from '../../lib/styles.js';
|
|
5
|
+
import { machineOutputFlags } from '../../lib/pmo/base-command.js';
|
|
6
|
+
import { isAgentMode, outputPromptAsJson, createMetadata, normalizeChoices, } from '../../lib/prompt-json.js';
|
|
5
7
|
export default class TerminalTitle extends Command {
|
|
6
8
|
static description = 'Set the terminal tab/window title';
|
|
7
9
|
static examples = [
|
|
8
10
|
'<%= config.bin %> <%= command.id %> "My Custom Name"',
|
|
9
11
|
'<%= config.bin %> <%= command.id %> # Interactive prompt',
|
|
10
12
|
'<%= config.bin %> <%= command.id %> --reset',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --machine # JSON mode for agents',
|
|
11
14
|
];
|
|
12
15
|
static args = {
|
|
13
16
|
title: Args.string({
|
|
@@ -21,7 +24,37 @@ export default class TerminalTitle extends Command {
|
|
|
21
24
|
description: 'Reset terminal title to default',
|
|
22
25
|
default: false,
|
|
23
26
|
}),
|
|
27
|
+
...machineOutputFlags,
|
|
24
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Prompt wrapper - drop-in replacement for inquirer.prompt with JSON mode support.
|
|
31
|
+
* Matches the pattern from PMOCommand.prompt().
|
|
32
|
+
*
|
|
33
|
+
* In JSON mode: outputs prompt config as JSON and exits
|
|
34
|
+
* In interactive mode: shows normal inquirer prompt
|
|
35
|
+
*/
|
|
36
|
+
async prompt(questions, jsonModeConfig) {
|
|
37
|
+
// Check for JSON/agent mode
|
|
38
|
+
if (jsonModeConfig && isAgentMode(jsonModeConfig.flags)) {
|
|
39
|
+
const firstQuestion = questions[0];
|
|
40
|
+
if (firstQuestion) {
|
|
41
|
+
const choices = firstQuestion.choices
|
|
42
|
+
? normalizeChoices(firstQuestion.choices)
|
|
43
|
+
: undefined;
|
|
44
|
+
outputPromptAsJson({
|
|
45
|
+
type: firstQuestion.type,
|
|
46
|
+
name: firstQuestion.name,
|
|
47
|
+
message: firstQuestion.message,
|
|
48
|
+
choices,
|
|
49
|
+
default: firstQuestion.default,
|
|
50
|
+
}, createMetadata(jsonModeConfig.commandName, jsonModeConfig.flags));
|
|
51
|
+
// outputPromptAsJson calls process.exit, never returns
|
|
52
|
+
}
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
// Interactive mode: just call inquirer
|
|
56
|
+
return inquirer.prompt(questions);
|
|
57
|
+
}
|
|
25
58
|
async run() {
|
|
26
59
|
const { args, flags } = await this.parse(TerminalTitle);
|
|
27
60
|
// Handle reset flag
|
|
@@ -33,12 +66,13 @@ export default class TerminalTitle extends Command {
|
|
|
33
66
|
// Get title from args or prompt
|
|
34
67
|
let title = args.title;
|
|
35
68
|
if (!title) {
|
|
36
|
-
const
|
|
69
|
+
const jsonModeConfig = isAgentMode(flags) ? { flags, commandName: 'terminal title' } : null;
|
|
70
|
+
const response = await this.prompt([{
|
|
37
71
|
type: 'input',
|
|
38
72
|
name: 'title',
|
|
39
73
|
message: 'Enter terminal title:',
|
|
40
|
-
validate: (input) => input.length > 0 || 'Title cannot be empty',
|
|
41
|
-
}]);
|
|
74
|
+
validate: (input) => (typeof input === 'string' && input.length > 0) || 'Title cannot be empty',
|
|
75
|
+
}], jsonModeConfig);
|
|
42
76
|
title = response.title;
|
|
43
77
|
}
|
|
44
78
|
// Set the title
|
|
@@ -4,6 +4,7 @@ export default class TicketBulk extends PMOCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
};
|
|
9
10
|
protected getPMOOptions(): {
|
|
@@ -9,6 +9,7 @@ export default class TicketComplete extends PMOCommand {
|
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
bulk: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
machine: 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>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
2
|
import { autoExportToBoard, PMOCommand, pmoBaseFlags, } from '../../lib/pmo/index.js';
|
|
4
3
|
import { styles } from '../../lib/styles.js';
|
|
5
4
|
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
@@ -66,7 +65,7 @@ export default class TicketComplete extends PMOCommand {
|
|
|
66
65
|
}
|
|
67
66
|
// Bulk mode
|
|
68
67
|
if (flags.bulk) {
|
|
69
|
-
await this.executeBulk(incompleteTickets, doneColumn.name, flags
|
|
68
|
+
await this.executeBulk(incompleteTickets, doneColumn.name, flags);
|
|
70
69
|
return;
|
|
71
70
|
}
|
|
72
71
|
// Single ticket mode
|
|
@@ -77,7 +76,7 @@ export default class TicketComplete extends PMOCommand {
|
|
|
77
76
|
items: incompleteTickets,
|
|
78
77
|
getName: (t) => `${t.id} - ${t.title} (${t.statusName})`,
|
|
79
78
|
getValue: (t) => t.id,
|
|
80
|
-
getCommand: (t) => `prlt ticket complete ${t.id} --json`,
|
|
79
|
+
getCommand: (t) => `prlt ticket complete ${t.id}${projectId ? ` -P ${projectId}` : ''} --json`,
|
|
81
80
|
jsonMode: jsonMode ? { flags, commandName: 'ticket complete' } : null,
|
|
82
81
|
});
|
|
83
82
|
if (!selected) {
|
|
@@ -98,40 +97,45 @@ export default class TicketComplete extends PMOCommand {
|
|
|
98
97
|
this.log(styles.muted(` Title: ${ticket.title}`));
|
|
99
98
|
this.log(styles.muted(` Moved to: ${doneColumn.name}`));
|
|
100
99
|
}
|
|
101
|
-
async executeBulk(incompleteTickets, doneColumnName,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
async executeBulk(incompleteTickets, doneColumnName, flags) {
|
|
101
|
+
// Only show header in interactive mode
|
|
102
|
+
if (!flags.json) {
|
|
103
|
+
this.log(styles.emphasis('✅ Complete Multiple Tickets\n'));
|
|
104
|
+
}
|
|
105
|
+
// Agent mode config for prompts
|
|
106
|
+
const jsonModeConfig = flags.json ? { flags, commandName: 'ticket complete --bulk' } : null;
|
|
107
|
+
// Select tickets to complete (now agent-compatible!)
|
|
108
|
+
const { selectedTickets } = await this.prompt([{
|
|
105
109
|
type: 'checkbox',
|
|
106
110
|
name: 'selectedTickets',
|
|
107
111
|
message: 'Select tickets to mark as COMPLETE:',
|
|
108
112
|
choices: incompleteTickets.map(t => ({
|
|
109
113
|
name: `${t.id} - ${t.title} (${t.statusName})`,
|
|
110
114
|
value: t.id,
|
|
115
|
+
command: `prlt ticket complete ${t.id}${flags.project ? ` -P ${flags.project}` : ''} --json`, // For agent: complete single ticket
|
|
111
116
|
})),
|
|
112
|
-
}]);
|
|
117
|
+
}], jsonModeConfig);
|
|
113
118
|
if (selectedTickets.length === 0) {
|
|
114
119
|
this.log(styles.muted('No tickets selected.'));
|
|
115
120
|
return;
|
|
116
121
|
}
|
|
117
122
|
// Confirmation
|
|
118
|
-
if (!force) {
|
|
123
|
+
if (!flags.force) {
|
|
119
124
|
this.log(styles.primary('\nWill mark as complete:'));
|
|
120
125
|
for (const ticketId of selectedTickets) {
|
|
121
126
|
const ticket = incompleteTickets.find(t => t.id === ticketId);
|
|
122
127
|
this.log(styles.primary(` • ${ticketId}: ${ticket?.title}`));
|
|
123
128
|
}
|
|
124
129
|
this.log(styles.primary(` → Move to: ${doneColumnName}\n`));
|
|
125
|
-
const { confirm } = await
|
|
130
|
+
const { confirm } = await this.prompt([{
|
|
126
131
|
type: 'list',
|
|
127
132
|
name: 'confirm',
|
|
128
133
|
message: 'Continue?',
|
|
129
134
|
choices: [
|
|
130
|
-
{ name: 'No, cancel', value: false },
|
|
131
|
-
{ name: 'Yes, complete tickets', value: true }
|
|
135
|
+
{ name: 'No, cancel', value: 'false', command: '' },
|
|
136
|
+
{ name: 'Yes, complete tickets', value: 'true', command: `prlt ticket complete ${selectedTickets.join(' ')}${flags.project ? ` -P ${flags.project}` : ''} --force --json` }
|
|
132
137
|
],
|
|
133
|
-
|
|
134
|
-
}]);
|
|
138
|
+
}], jsonModeConfig);
|
|
135
139
|
if (!confirm) {
|
|
136
140
|
this.log(styles.muted('Operation cancelled.'));
|
|
137
141
|
return;
|
|
@@ -14,6 +14,7 @@ export default class TicketCreate extends PMOCommand {
|
|
|
14
14
|
epic: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
template: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
16
|
labels: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
19
|
};
|
|
19
20
|
execute(): Promise<void>;
|
|
@@ -4,7 +4,8 @@ import { autoExportToBoard, PMOCommand, pmoBaseFlags } from '../../lib/pmo/index
|
|
|
4
4
|
import { styles } from '../../lib/styles.js';
|
|
5
5
|
import { updateEpicTicketsSection } from '../../lib/pmo/epic-files.js';
|
|
6
6
|
import { PRIORITIES, PRIORITY_LABELS } from '../../lib/pmo/types.js';
|
|
7
|
-
import { shouldOutputJson,
|
|
7
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
8
|
+
import { FlagResolver } from '../../lib/flags/index.js';
|
|
8
9
|
export default class TicketCreate extends PMOCommand {
|
|
9
10
|
static description = 'Create a new ticket on the PMO board';
|
|
10
11
|
static examples = [
|
|
@@ -85,20 +86,6 @@ export default class TicketCreate extends PMOCommand {
|
|
|
85
86
|
}
|
|
86
87
|
this.error(message);
|
|
87
88
|
};
|
|
88
|
-
// In JSON mode without required data, output column selection prompt
|
|
89
|
-
if (jsonMode && !flags.title && !flags.column) {
|
|
90
|
-
// Build base command with project if specified
|
|
91
|
-
const baseCmd = flags.project
|
|
92
|
-
? `prlt ticket create -P ${flags.project}`
|
|
93
|
-
: 'prlt ticket create';
|
|
94
|
-
const columnChoices = columns.map(c => ({
|
|
95
|
-
name: c,
|
|
96
|
-
value: c,
|
|
97
|
-
command: `${baseCmd} --column "${c}" --json`,
|
|
98
|
-
}));
|
|
99
|
-
outputPromptAsJson(buildPromptConfig('list', 'column', 'Select column to place the ticket in:', columnChoices), createMetadata('ticket create', flags));
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
89
|
// Validate epic if provided
|
|
103
90
|
if (flags.epic) {
|
|
104
91
|
const epic = await this.storage.getEpic(flags.epic);
|
|
@@ -120,42 +107,59 @@ export default class TicketCreate extends PMOCommand {
|
|
|
120
107
|
: undefined;
|
|
121
108
|
// Get ticket data (interactive or from flags)
|
|
122
109
|
let ticketData;
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
:
|
|
128
|
-
|
|
110
|
+
// Use FlagResolver to handle both JSON mode and interactive prompts
|
|
111
|
+
// This unifies the two code paths into one pattern
|
|
112
|
+
if (!flags.interactive) {
|
|
113
|
+
const resolver = new FlagResolver({
|
|
114
|
+
commandName: 'ticket create',
|
|
115
|
+
baseCommand: 'prlt ticket create',
|
|
116
|
+
jsonMode,
|
|
117
|
+
flags,
|
|
118
|
+
context: { projectId },
|
|
119
|
+
});
|
|
120
|
+
// Column selection - prompted first if missing
|
|
121
|
+
resolver.addPrompt({
|
|
122
|
+
flagName: 'column',
|
|
123
|
+
type: 'list',
|
|
124
|
+
message: 'Select column to place the ticket in:',
|
|
125
|
+
choices: () => columns.map(c => ({ name: c, value: c })),
|
|
126
|
+
when: (ctx) => !ctx.flags.column,
|
|
127
|
+
});
|
|
128
|
+
// Title input - prompted after column is set
|
|
129
|
+
resolver.addPrompt({
|
|
130
|
+
flagName: 'title',
|
|
129
131
|
type: 'input',
|
|
130
|
-
name: 'title',
|
|
131
132
|
message: 'Enter ticket title:',
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
when: (ctx) => !ctx.flags.title && ctx.flags.column !== undefined,
|
|
134
|
+
validate: (value) => value.length > 0 || 'Title is required',
|
|
135
|
+
context: (ctx) => ({
|
|
136
|
+
hint: `Provide title with: ${ctx.baseCommand}${ctx.projectId ? ` -P ${ctx.projectId}` : ''} --column "${ctx.flags.column}" --title "Your title here"`,
|
|
134
137
|
requiredFields: ['--title'],
|
|
135
138
|
optionalFields: ['--priority', '--category', '--description', '--epic', '--labels'],
|
|
136
|
-
example: `${
|
|
137
|
-
},
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
if (!flags.title && !template?.titlePattern) {
|
|
139
|
+
example: `${ctx.baseCommand}${ctx.projectId ? ` -P ${ctx.projectId}` : ''} --column "${ctx.flags.column}" --title "Fix login bug" --priority P1 --category bug`,
|
|
140
|
+
}),
|
|
141
|
+
});
|
|
142
|
+
// Resolve missing flags (in JSON mode, outputs prompt and exits; in interactive mode, prompts user)
|
|
143
|
+
const resolvedFlags = await resolver.resolve();
|
|
144
|
+
// If we get here, we have both column and title
|
|
145
|
+
if (!resolvedFlags.title && !template?.titlePattern) {
|
|
146
146
|
this.error('Title is required. Use --title or -t flag, or use --interactive mode.');
|
|
147
147
|
}
|
|
148
148
|
ticketData = {
|
|
149
|
-
title:
|
|
150
|
-
statusName:
|
|
151
|
-
priority:
|
|
152
|
-
category:
|
|
153
|
-
description:
|
|
154
|
-
id:
|
|
155
|
-
epicId:
|
|
149
|
+
title: resolvedFlags.title || template?.titlePattern || '',
|
|
150
|
+
statusName: resolvedFlags.column || columns[0],
|
|
151
|
+
priority: resolvedFlags.priority || template?.defaultPriority,
|
|
152
|
+
category: resolvedFlags.category || template?.defaultCategory,
|
|
153
|
+
description: resolvedFlags.description || template?.descriptionTemplate,
|
|
154
|
+
id: resolvedFlags.id,
|
|
155
|
+
epicId: resolvedFlags.epic,
|
|
156
156
|
labels: labelsFromFlag || template?.defaultLabels,
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
+
else {
|
|
160
|
+
// Full interactive mode - use the detailed prompts
|
|
161
|
+
ticketData = await this.promptTicketData(flags, this.storage, template, columns);
|
|
162
|
+
}
|
|
159
163
|
// Validate status/column
|
|
160
164
|
if (!columns.includes(ticketData.statusName)) {
|
|
161
165
|
this.error(`Invalid column "${ticketData.statusName}". Available columns: ${columns.join(', ')}`);
|
|
@@ -9,6 +9,7 @@ export default class TicketDelete extends PMOCommand {
|
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
bulk: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
machine: 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>;
|
|
@@ -67,7 +67,7 @@ export default class TicketDelete extends PMOCommand {
|
|
|
67
67
|
items: allTickets,
|
|
68
68
|
getName: (t) => `${t.id} - ${t.title} (${t.statusName})`,
|
|
69
69
|
getValue: (t) => t.id,
|
|
70
|
-
getCommand: (t) => `prlt ticket delete ${t.id} --force --json`,
|
|
70
|
+
getCommand: (t) => `prlt ticket delete ${t.id}${projectId ? ` -P ${projectId}` : ''} --force --json`,
|
|
71
71
|
jsonMode: jsonMode ? { flags, commandName: 'ticket delete' } : null,
|
|
72
72
|
});
|
|
73
73
|
if (!selected) {
|
|
@@ -20,6 +20,7 @@ export default class TicketEdit extends PMOCommand {
|
|
|
20
20
|
'clear-ac': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
21
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
22
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
23
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
23
24
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
25
|
};
|
|
25
26
|
execute(): Promise<void>;
|
|
@@ -107,7 +107,7 @@ export default class TicketEdit extends PMOCommand {
|
|
|
107
107
|
items: allTickets,
|
|
108
108
|
getName: (t) => `${t.id} - ${t.title} (${t.statusName})`,
|
|
109
109
|
getValue: (t) => t.id,
|
|
110
|
-
getCommand: (t) => `prlt ticket edit ${t.id} --json`,
|
|
110
|
+
getCommand: (t) => `prlt ticket edit ${t.id}${projectId ? ` -P ${projectId}` : ''} --json`,
|
|
111
111
|
jsonMode: jsonMode ? { flags, commandName: 'ticket edit' } : null,
|
|
112
112
|
});
|
|
113
113
|
if (!selected) {
|