@proletariat/cli 0.3.17 → 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 +12 -6
- package/dist/lib/execution/runners.js +13 -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 +3985 -2372
- package/package.json +3 -1
|
@@ -18,9 +18,15 @@ export default class ThemesSet extends Command {
|
|
|
18
18
|
}),
|
|
19
19
|
};
|
|
20
20
|
static flags = {
|
|
21
|
+
machine: Flags.boolean({
|
|
22
|
+
char: 'm',
|
|
23
|
+
description: 'Output as JSON for AI agents/scripts (machine-readable mode)',
|
|
24
|
+
default: false,
|
|
25
|
+
}),
|
|
21
26
|
json: Flags.boolean({
|
|
22
|
-
description: 'Output
|
|
27
|
+
description: 'Output as JSON (deprecated, use --machine)',
|
|
23
28
|
default: false,
|
|
29
|
+
hidden: true,
|
|
24
30
|
}),
|
|
25
31
|
};
|
|
26
32
|
async run() {
|
|
@@ -7,6 +7,7 @@ export default class Visit extends PMOCommand {
|
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
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(): {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import inquirer from 'inquirer';
|
|
4
3
|
import { colors } from '../../lib/colors.js';
|
|
5
4
|
import { getWorkspaceInfo } from '../../lib/agents/commands.js';
|
|
6
5
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
7
|
-
import { shouldOutputJson,
|
|
6
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
8
7
|
export default class Visit extends PMOCommand {
|
|
9
8
|
static description = 'Navigate to agent directory';
|
|
10
9
|
static examples = [
|
|
@@ -50,38 +49,27 @@ export default class Visit extends PMOCommand {
|
|
|
50
49
|
return;
|
|
51
50
|
}
|
|
52
51
|
let agentName = args.name;
|
|
52
|
+
// Agent mode config for prompts
|
|
53
|
+
const agentConfig = jsonMode ? { flags, commandName: 'agent visit' } : null;
|
|
53
54
|
// Interactive mode if no agent specified
|
|
54
55
|
if (!agentName) {
|
|
55
|
-
// In JSON mode, output agent selection prompt
|
|
56
|
-
if (jsonMode) {
|
|
57
|
-
const agentChoices = workspaceInfo.agents.map((agent) => ({ name: agent.name, value: agent.name }));
|
|
58
|
-
outputPromptAsJson(buildPromptConfig('list', 'name', 'Select agent to visit:', agentChoices), createMetadata('agent visit', flags));
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
56
|
// Group agents by type
|
|
62
57
|
const staffAgents = workspaceInfo.agents.filter(a => a.type === 'persistent');
|
|
63
58
|
const tempAgents = workspaceInfo.agents.filter(a => a.type === 'ephemeral');
|
|
59
|
+
// Build choices with command field for JSON mode
|
|
64
60
|
const choices = [];
|
|
65
|
-
|
|
66
|
-
choices.push(
|
|
67
|
-
for (const agent of staffAgents) {
|
|
68
|
-
choices.push({ name: `👔 ${agent.name}`, value: agent.name });
|
|
69
|
-
}
|
|
61
|
+
for (const agent of staffAgents) {
|
|
62
|
+
choices.push({ name: `👔 ${agent.name}`, value: agent.name, command: `prlt agent visit ${agent.name} --machine` });
|
|
70
63
|
}
|
|
71
|
-
|
|
72
|
-
choices.push(
|
|
73
|
-
for (const agent of tempAgents) {
|
|
74
|
-
choices.push({ name: `⏱️ ${agent.name}`, value: agent.name });
|
|
75
|
-
}
|
|
64
|
+
for (const agent of tempAgents) {
|
|
65
|
+
choices.push({ name: `⏱️ ${agent.name}`, value: agent.name, command: `prlt agent visit ${agent.name} --machine` });
|
|
76
66
|
}
|
|
77
|
-
const { selected } = await
|
|
78
|
-
{
|
|
67
|
+
const { selected } = await this.prompt([{
|
|
79
68
|
type: 'list',
|
|
80
69
|
name: 'selected',
|
|
81
70
|
message: 'Select agent to visit:',
|
|
82
|
-
choices
|
|
83
|
-
}
|
|
84
|
-
]);
|
|
71
|
+
choices,
|
|
72
|
+
}], agentConfig);
|
|
85
73
|
agentName = selected;
|
|
86
74
|
}
|
|
87
75
|
// Validate agent exists
|
|
@@ -5,8 +5,19 @@ export default class AutocompleteSetup extends Command {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
install: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
shell: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
10
|
};
|
|
9
11
|
run(): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Handle JSON mode when --shell flag is provided.
|
|
14
|
+
* Performs the install if requested and outputs success JSON.
|
|
15
|
+
*/
|
|
16
|
+
private handleJsonModeWithShell;
|
|
17
|
+
/**
|
|
18
|
+
* Perform the actual install without logging (for JSON mode).
|
|
19
|
+
*/
|
|
20
|
+
private doInstallQuiet;
|
|
10
21
|
private detectShell;
|
|
11
22
|
private getShellConfig;
|
|
12
23
|
private showInstructions;
|
|
@@ -3,14 +3,20 @@ import * as fs from 'node:fs';
|
|
|
3
3
|
import * as path from 'node:path';
|
|
4
4
|
import * as os from 'node:os';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
|
+
import inquirer from 'inquirer';
|
|
7
|
+
import { machineOutputFlags } from '../../lib/pmo/base-command.js';
|
|
8
|
+
import { isAgentMode, outputPromptAsJson, outputSuccessAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
9
|
+
const SUPPORTED_SHELLS = ['zsh', 'bash', 'powershell'];
|
|
6
10
|
export default class AutocompleteSetup extends Command {
|
|
7
11
|
static description = 'Auto-detect shell and set up autocomplete';
|
|
8
12
|
static examples = [
|
|
9
13
|
'<%= config.bin %> <%= command.id %>',
|
|
10
14
|
'<%= config.bin %> <%= command.id %> --install',
|
|
11
15
|
'<%= config.bin %> <%= command.id %> --shell zsh',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> --shell zsh --install --machine',
|
|
12
17
|
];
|
|
13
18
|
static flags = {
|
|
19
|
+
...machineOutputFlags,
|
|
14
20
|
install: Flags.boolean({
|
|
15
21
|
char: 'i',
|
|
16
22
|
description: 'Automatically install to shell config file',
|
|
@@ -24,21 +30,120 @@ export default class AutocompleteSetup extends Command {
|
|
|
24
30
|
};
|
|
25
31
|
async run() {
|
|
26
32
|
const { flags } = await this.parse(AutocompleteSetup);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
const jsonMode = isAgentMode(flags);
|
|
34
|
+
const jsonModeConfig = jsonMode ? { flags, commandName: 'autocomplete setup' } : null;
|
|
35
|
+
// If --shell flag provided, skip detection and proceed directly
|
|
36
|
+
if (flags.shell) {
|
|
37
|
+
const shell = flags.shell;
|
|
38
|
+
if (jsonModeConfig) {
|
|
39
|
+
// JSON mode with --shell: perform action and output success
|
|
40
|
+
return this.handleJsonModeWithShell(shell, flags.install, jsonModeConfig);
|
|
41
|
+
}
|
|
42
|
+
// Interactive mode with --shell: original behavior
|
|
43
|
+
this.log(chalk.cyan(`Shell: ${shell}`));
|
|
44
|
+
this.log('');
|
|
45
|
+
const { configFile, snippet } = this.getShellConfig(shell);
|
|
46
|
+
if (flags.install) {
|
|
47
|
+
await this.installAutocomplete(shell, configFile, snippet);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.showInstructions(shell, configFile, snippet);
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// No --shell flag: detect shell
|
|
55
|
+
const detectedShell = this.detectShell();
|
|
56
|
+
// JSON mode without --shell: always output shell selection prompt
|
|
57
|
+
if (jsonModeConfig) {
|
|
58
|
+
const choices = SUPPORTED_SHELLS.map(s => ({
|
|
59
|
+
name: s === detectedShell ? `${s} (detected)` : s,
|
|
60
|
+
value: s,
|
|
61
|
+
command: `prlt autocomplete setup --shell ${s} --install --machine`,
|
|
62
|
+
}));
|
|
63
|
+
outputPromptAsJson({
|
|
64
|
+
type: 'list',
|
|
65
|
+
name: 'shell',
|
|
66
|
+
message: 'Select shell for autocomplete setup:',
|
|
67
|
+
choices,
|
|
68
|
+
default: detectedShell !== 'unknown' ? detectedShell : undefined,
|
|
69
|
+
}, createMetadata(jsonModeConfig.commandName, jsonModeConfig.flags));
|
|
70
|
+
return; // unreachable - outputPromptAsJson exits
|
|
71
|
+
}
|
|
72
|
+
// Interactive mode without --shell
|
|
73
|
+
if (detectedShell === 'unknown') {
|
|
74
|
+
// Shell not detected: prompt user to select
|
|
75
|
+
const { selectedShell } = await inquirer.prompt([{
|
|
76
|
+
type: 'list',
|
|
77
|
+
name: 'selectedShell',
|
|
78
|
+
message: 'Could not detect shell. Select your shell:',
|
|
79
|
+
choices: SUPPORTED_SHELLS.map(s => ({ name: s, value: s })),
|
|
80
|
+
}]);
|
|
81
|
+
this.log('');
|
|
82
|
+
const shell = selectedShell;
|
|
83
|
+
const { configFile, snippet } = this.getShellConfig(shell);
|
|
84
|
+
if (flags.install) {
|
|
85
|
+
await this.installAutocomplete(shell, configFile, snippet);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.showInstructions(shell, configFile, snippet);
|
|
89
|
+
}
|
|
31
90
|
return;
|
|
32
91
|
}
|
|
33
|
-
|
|
92
|
+
// Shell detected: proceed with original behavior
|
|
93
|
+
this.log(chalk.cyan(`Detected shell: ${detectedShell}`));
|
|
34
94
|
this.log('');
|
|
35
|
-
const { configFile, snippet } = this.getShellConfig(
|
|
95
|
+
const { configFile, snippet } = this.getShellConfig(detectedShell);
|
|
36
96
|
if (flags.install) {
|
|
37
|
-
await this.installAutocomplete(
|
|
97
|
+
await this.installAutocomplete(detectedShell, configFile, snippet);
|
|
38
98
|
}
|
|
39
99
|
else {
|
|
40
|
-
this.showInstructions(
|
|
100
|
+
this.showInstructions(detectedShell, configFile, snippet);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Handle JSON mode when --shell flag is provided.
|
|
105
|
+
* Performs the install if requested and outputs success JSON.
|
|
106
|
+
*/
|
|
107
|
+
async handleJsonModeWithShell(shell, install, jsonModeConfig) {
|
|
108
|
+
const { configFile, snippet } = this.getShellConfig(shell);
|
|
109
|
+
if (install) {
|
|
110
|
+
const result = await this.doInstallQuiet(shell, configFile, snippet);
|
|
111
|
+
outputSuccessAsJson({ shell, configFile, snippet, ...result }, createMetadata(jsonModeConfig.commandName, jsonModeConfig.flags));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// No --install: output config info as success
|
|
115
|
+
outputSuccessAsJson({
|
|
116
|
+
shell,
|
|
117
|
+
configFile,
|
|
118
|
+
snippet,
|
|
119
|
+
installed: false,
|
|
120
|
+
installCommand: `prlt autocomplete setup --shell ${shell} --install`,
|
|
121
|
+
}, createMetadata(jsonModeConfig.commandName, jsonModeConfig.flags));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Perform the actual install without logging (for JSON mode).
|
|
125
|
+
*/
|
|
126
|
+
async doInstallQuiet(shell, configFile, snippet) {
|
|
127
|
+
const configExists = fs.existsSync(configFile);
|
|
128
|
+
if (configExists) {
|
|
129
|
+
const content = fs.readFileSync(configFile, 'utf-8');
|
|
130
|
+
if (content.includes('prlt autocomplete')) {
|
|
131
|
+
return { installed: false, alreadyConfigured: true };
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const configDir = path.dirname(configFile);
|
|
135
|
+
if (!fs.existsSync(configDir)) {
|
|
136
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
137
|
+
}
|
|
138
|
+
const addition = `\n# Proletariat CLI autocomplete\n${snippet}\n`;
|
|
139
|
+
fs.appendFileSync(configFile, addition);
|
|
140
|
+
try {
|
|
141
|
+
await this.config.runCommand('autocomplete', [shell, '--refresh-cache']);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// Ignore refresh cache errors
|
|
41
145
|
}
|
|
146
|
+
return { installed: true, alreadyConfigured: false };
|
|
42
147
|
}
|
|
43
148
|
detectShell() {
|
|
44
149
|
// Check for PowerShell first (works on all platforms)
|
|
@@ -3,10 +3,14 @@ export default class Board extends PMOCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
action: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
10
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
11
|
};
|
|
9
12
|
execute(): Promise<void>;
|
|
13
|
+
private executeAction;
|
|
10
14
|
private viewBoard;
|
|
11
15
|
private outputTicketCompact;
|
|
12
16
|
private outputTicketFull;
|
|
@@ -2,10 +2,9 @@ import * as fs from 'node:fs';
|
|
|
2
2
|
import { execSync } from 'node:child_process';
|
|
3
3
|
import { Flags } from '@oclif/core';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
|
-
import inquirer from 'inquirer';
|
|
6
5
|
import { parseBoard, findAddedTickets, findRemovedTickets, findModifiedTickets, getBoardPath, PMOCommand, pmoBaseFlags, } from '../../lib/pmo/index.js';
|
|
7
6
|
import { styles, formatPriority, formatCategory, getColumnStyle, getColumnEmoji, divider, } from '../../lib/styles.js';
|
|
8
|
-
import { shouldOutputJson
|
|
7
|
+
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
9
8
|
export default class Board extends PMOCommand {
|
|
10
9
|
static description = 'Interactive menu for board operations';
|
|
11
10
|
static examples = [
|
|
@@ -13,8 +12,12 @@ export default class Board extends PMOCommand {
|
|
|
13
12
|
];
|
|
14
13
|
static flags = {
|
|
15
14
|
...pmoBaseFlags,
|
|
16
|
-
|
|
17
|
-
description: '
|
|
15
|
+
action: Flags.string({
|
|
16
|
+
description: 'Action to execute directly (view, markdown, export, sync)',
|
|
17
|
+
options: ['view', 'open', 'markdown', 'export', 'sync'],
|
|
18
|
+
}),
|
|
19
|
+
force: Flags.boolean({
|
|
20
|
+
description: 'Skip confirmation prompts',
|
|
18
21
|
default: false,
|
|
19
22
|
}),
|
|
20
23
|
};
|
|
@@ -22,39 +25,39 @@ export default class Board extends PMOCommand {
|
|
|
22
25
|
const { flags } = await this.parse(Board);
|
|
23
26
|
// Board operations require project context
|
|
24
27
|
const projectId = await this.requireProject();
|
|
28
|
+
// If --action flag provided, execute directly without menu
|
|
29
|
+
if (flags.action) {
|
|
30
|
+
await this.executeAction(flags.action, projectId, flags);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
25
33
|
// Check if JSON output mode is active
|
|
26
34
|
const jsonMode = shouldOutputJson(flags);
|
|
35
|
+
const agentConfig = jsonMode ? { flags, commandName: 'board' } : null;
|
|
27
36
|
// Define choices once, use for both JSON and interactive modes
|
|
28
37
|
const menuChoices = [
|
|
29
|
-
{ name: 'View board in terminal', value: 'view' },
|
|
30
|
-
{ name: 'Open board in Obsidian', value: 'open' },
|
|
31
|
-
{ name: 'Show as markdown', value: 'markdown' },
|
|
32
|
-
{ name: 'Export board', value: 'export' },
|
|
33
|
-
{ name: 'Sync board', value: 'sync' },
|
|
34
|
-
{ name: 'Watch for changes', value: 'watch' },
|
|
35
|
-
{ name: 'Cancel', value: 'cancel' },
|
|
38
|
+
{ name: 'View board in terminal', value: 'view', command: `prlt board --action view -P ${projectId} --json` },
|
|
39
|
+
{ name: 'Open board in Obsidian', value: 'open', command: `prlt board --action open -P ${projectId} --json` },
|
|
40
|
+
{ name: 'Show as markdown', value: 'markdown', command: `prlt board --action markdown -P ${projectId} --json` },
|
|
41
|
+
{ name: 'Export board', value: 'export', command: `prlt board --action export -P ${projectId} --json` },
|
|
42
|
+
{ name: 'Sync board', value: 'sync', command: `prlt board --action sync -P ${projectId} --force --json` },
|
|
43
|
+
{ name: 'Watch for changes', value: 'watch', command: `prlt board watch -P ${projectId}` },
|
|
44
|
+
{ name: 'Cancel', value: 'cancel', command: '' },
|
|
36
45
|
];
|
|
37
46
|
const projectName = await this.getProjectName(projectId);
|
|
38
47
|
const message = `Board Operations - ${projectName} - What would you like to do?`;
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
outputPromptAsJson(buildPromptConfig('list', 'action', message, menuChoices), createMetadata('board', flags));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
// Show interactive menu (with separator before Cancel)
|
|
45
|
-
const { action } = await inquirer.prompt([{
|
|
48
|
+
// Use this.prompt for both JSON and interactive modes
|
|
49
|
+
const { action } = await this.prompt([{
|
|
46
50
|
type: 'list',
|
|
47
51
|
name: 'action',
|
|
48
52
|
message: '📋 ' + message,
|
|
49
|
-
choices:
|
|
50
|
-
|
|
51
|
-
new inquirer.Separator(),
|
|
52
|
-
menuChoices[menuChoices.length - 1],
|
|
53
|
-
],
|
|
54
|
-
}]);
|
|
53
|
+
choices: menuChoices,
|
|
54
|
+
}], agentConfig);
|
|
55
55
|
if (action === 'cancel') {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
+
await this.executeAction(action, projectId, flags);
|
|
59
|
+
}
|
|
60
|
+
async executeAction(action, projectId, flags) {
|
|
58
61
|
switch (action) {
|
|
59
62
|
case 'view':
|
|
60
63
|
await this.viewBoard(projectId, { all: false, compact: false });
|
|
@@ -69,7 +72,7 @@ export default class Board extends PMOCommand {
|
|
|
69
72
|
await this.exportMarkdown(projectId);
|
|
70
73
|
break;
|
|
71
74
|
case 'sync':
|
|
72
|
-
await this.syncFromMarkdown(projectId, { force: false, 'dry-run': false });
|
|
75
|
+
await this.syncFromMarkdown(projectId, { force: flags.force ?? false, 'dry-run': false });
|
|
73
76
|
break;
|
|
74
77
|
case 'watch':
|
|
75
78
|
this.log(styles.info('To watch for changes, run: prlt board watch'));
|
|
@@ -207,16 +210,15 @@ export default class Board extends PMOCommand {
|
|
|
207
210
|
}
|
|
208
211
|
// Confirm before applying
|
|
209
212
|
if (!flags.force) {
|
|
210
|
-
const { confirm } = await
|
|
213
|
+
const { confirm } = await this.prompt([{
|
|
211
214
|
type: 'list',
|
|
212
215
|
name: 'confirm',
|
|
213
216
|
message: 'Apply these changes to the database?',
|
|
214
217
|
choices: [
|
|
215
|
-
{ name: 'Yes, apply changes', value: true },
|
|
216
|
-
{ name: 'No, cancel', value: false },
|
|
218
|
+
{ name: 'Yes, apply changes', value: true, command: `prlt board --action sync -P ${projectId} --force --json` },
|
|
219
|
+
{ name: 'No, cancel', value: false, command: '' },
|
|
217
220
|
],
|
|
218
|
-
|
|
219
|
-
}]);
|
|
221
|
+
}], null);
|
|
220
222
|
if (!confirm) {
|
|
221
223
|
this.log(chalk.yellow('Sync cancelled.'));
|
|
222
224
|
return;
|
|
@@ -4,6 +4,8 @@ export default class BoardWatch extends PMOCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
debounce: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
9
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
10
|
};
|
|
9
11
|
protected getPMOOptions(): {
|
|
@@ -19,6 +19,7 @@ export default class BranchCreate extends PMOCommand {
|
|
|
19
19
|
'from-origin': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
20
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
21
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
23
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
24
|
};
|
|
24
25
|
protected getPMOOptions(): {
|
|
@@ -5,7 +5,7 @@ import inquirer from 'inquirer';
|
|
|
5
5
|
import Database from 'better-sqlite3';
|
|
6
6
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
7
7
|
import { styles } from '../../lib/styles.js';
|
|
8
|
-
import { shouldOutputJson,
|
|
8
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
9
9
|
import { BRANCH_TYPES, DEVELOPMENT_TYPES, BUSINESS_TYPES, isKebabCase, isValidBranchType, buildBranchName, toKebabCase, validateBranchName, branchExists, createBranch, createEmptyCommit, isGitRepo, fetchOrigin, checkoutBranch, listBranches, } from '../../lib/branch/index.js';
|
|
10
10
|
import { getCoderName, getGitUserName, getGitHubUsername } from '../../lib/execution/config.js';
|
|
11
11
|
import { getBranchType } from '../../lib/execution/types.js';
|
|
@@ -98,28 +98,21 @@ export default class BranchCreate extends PMOCommand {
|
|
|
98
98
|
branchName = args.name;
|
|
99
99
|
const validation = validateBranchName(branchName);
|
|
100
100
|
if (!validation.valid) {
|
|
101
|
-
// Build choices
|
|
101
|
+
// Build choices for validation warning
|
|
102
102
|
const confirmChoices = [
|
|
103
|
-
{ name: 'No', value: 'false' },
|
|
104
|
-
{ name: 'Yes', value: 'true' },
|
|
103
|
+
{ name: 'No', value: 'false', command: '' },
|
|
104
|
+
{ name: 'Yes', value: 'true', command: `prlt branch create "${args.name}" --force --json` },
|
|
105
105
|
];
|
|
106
106
|
const confirmMessage = `Branch name doesn't follow conventional format. ${validation.error} Continue anyway?`;
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
// Warn but allow creation
|
|
113
|
-
const { proceed } = await inquirer.prompt([
|
|
114
|
-
{
|
|
107
|
+
// Use prompt for JSON mode support
|
|
108
|
+
const agentConfig = jsonMode ? { flags, commandName: 'branch create' } : null;
|
|
109
|
+
const { proceed } = await this.prompt([{
|
|
115
110
|
type: 'list',
|
|
116
111
|
name: 'proceed',
|
|
117
|
-
message: confirmMessage
|
|
118
|
-
choices: confirmChoices
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
]);
|
|
122
|
-
if (!proceed) {
|
|
112
|
+
message: confirmMessage,
|
|
113
|
+
choices: confirmChoices,
|
|
114
|
+
}], agentConfig);
|
|
115
|
+
if (proceed !== 'true') {
|
|
123
116
|
return;
|
|
124
117
|
}
|
|
125
118
|
}
|
|
@@ -208,8 +201,8 @@ export default class BranchCreate extends PMOCommand {
|
|
|
208
201
|
// Initial commit to seed PR title
|
|
209
202
|
const autoCommit = this._autoCommit;
|
|
210
203
|
let createCommit = flags['empty-commit'] || autoCommit;
|
|
211
|
-
if (!createCommit && !args.name) {
|
|
212
|
-
// Only prompt in interactive mode (non-quick)
|
|
204
|
+
if (!createCommit && !args.name && !jsonMode) {
|
|
205
|
+
// Only prompt in interactive mode (non-quick, not JSON mode)
|
|
213
206
|
const { wantCommit } = await inquirer.prompt([
|
|
214
207
|
{
|
|
215
208
|
type: 'list',
|
|
@@ -230,9 +223,9 @@ export default class BranchCreate extends PMOCommand {
|
|
|
230
223
|
const defaultCommitMessage = selectedTicket
|
|
231
224
|
? `${selectedTicket.id}: ${selectedTicket.title}`
|
|
232
225
|
: branchName;
|
|
233
|
-
// In autoCommit mode, skip the prompt
|
|
226
|
+
// In autoCommit mode or JSON mode, skip the prompt
|
|
234
227
|
let commitMessage = defaultCommitMessage;
|
|
235
|
-
if (!autoCommit) {
|
|
228
|
+
if (!autoCommit && !jsonMode) {
|
|
236
229
|
const result = await inquirer.prompt([
|
|
237
230
|
{
|
|
238
231
|
type: 'input',
|
|
@@ -348,34 +341,33 @@ export default class BranchCreate extends PMOCommand {
|
|
|
348
341
|
}
|
|
349
342
|
// First choice: from ticket or custom
|
|
350
343
|
const hasTickets = tickets.length > 0;
|
|
351
|
-
// Build choices
|
|
344
|
+
// Build choices with command hints for AI agents
|
|
352
345
|
const modeChoices = [
|
|
353
346
|
...(hasTickets ? [
|
|
354
|
-
{ name: 'From ticket - quick', value: 'ticket-quick' },
|
|
355
|
-
{ name: 'From ticket - customize', value: 'ticket' },
|
|
347
|
+
{ name: 'From ticket - quick', value: 'ticket-quick', command: 'prlt branch create -T <TICKET_ID> --json' },
|
|
348
|
+
{ name: 'From ticket - customize', value: 'ticket', command: 'prlt branch create -T <TICKET_ID> --json' },
|
|
356
349
|
] : []),
|
|
357
|
-
{ name: 'Custom branch name', value: 'custom' },
|
|
350
|
+
{ name: 'Custom branch name', value: 'custom', command: 'prlt branch create -t <type> -d <description> --json' },
|
|
358
351
|
];
|
|
359
352
|
const modeMessage = 'Create branch:';
|
|
360
|
-
//
|
|
361
|
-
if (jsonMode) {
|
|
362
|
-
|
|
363
|
-
|
|
353
|
+
// Only show header in interactive mode
|
|
354
|
+
if (!jsonMode) {
|
|
355
|
+
this.log('');
|
|
356
|
+
this.log(styles.header('🌿 Create New Branch'));
|
|
357
|
+
this.log('');
|
|
364
358
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
this.
|
|
368
|
-
const { mode } = await inquirer.prompt([
|
|
369
|
-
{
|
|
359
|
+
// Use prompt for JSON mode support
|
|
360
|
+
const agentConfig = jsonMode ? { flags, commandName: 'branch create' } : null;
|
|
361
|
+
const { mode } = await this.prompt([{
|
|
370
362
|
type: 'list',
|
|
371
363
|
name: 'mode',
|
|
372
364
|
message: modeMessage,
|
|
373
|
-
choices: modeChoices
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
365
|
+
choices: modeChoices,
|
|
366
|
+
}], agentConfig);
|
|
367
|
+
// In JSON mode, prompt exits - this is never reached
|
|
368
|
+
if (!mode) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
379
371
|
if (mode === 'ticket-quick' && hasTickets) {
|
|
380
372
|
return this.runTicketQuickWizard(tickets, defaultOwnerName);
|
|
381
373
|
}
|
|
@@ -4,6 +4,7 @@ export default class Branch 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(): {
|
|
@@ -6,6 +6,8 @@ export default class BranchList extends PMOCommand {
|
|
|
6
6
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
11
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
12
|
};
|
|
11
13
|
protected getPMOOptions(): {
|
|
@@ -6,6 +6,8 @@ export default class BranchValidate extends PMOCommand {
|
|
|
6
6
|
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
11
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
12
|
};
|
|
11
13
|
protected getPMOOptions(): {
|
|
@@ -4,6 +4,7 @@ export default class BranchWhere 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
|
static args: {
|
|
@@ -13,6 +13,12 @@ export default class Claude extends Command {
|
|
|
13
13
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Prompt wrapper - handles both JSON mode and interactive mode.
|
|
18
|
+
* In JSON mode: outputs prompt as JSON and exits.
|
|
19
|
+
* In interactive mode: calls inquirer.prompt normally.
|
|
20
|
+
*/
|
|
21
|
+
private prompt;
|
|
16
22
|
run(): Promise<void>;
|
|
17
23
|
/**
|
|
18
24
|
* Run in "yolo mode" - outside any HQ
|