@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,8 +1,6 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
1
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
|
-
import inquirer from 'inquirer';
|
|
4
2
|
import { colors } from '../../lib/colors.js';
|
|
5
|
-
import { shouldOutputJson
|
|
3
|
+
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
6
4
|
export default class Repo extends PMOCommand {
|
|
7
5
|
static description = 'Repository management operations';
|
|
8
6
|
static examples = [
|
|
@@ -13,10 +11,6 @@ export default class Repo extends PMOCommand {
|
|
|
13
11
|
];
|
|
14
12
|
static flags = {
|
|
15
13
|
...pmoBaseFlags,
|
|
16
|
-
json: Flags.boolean({
|
|
17
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
18
|
-
default: false,
|
|
19
|
-
}),
|
|
20
14
|
};
|
|
21
15
|
getPMOOptions() {
|
|
22
16
|
return { promptIfMultiple: false };
|
|
@@ -25,42 +19,30 @@ export default class Repo extends PMOCommand {
|
|
|
25
19
|
const { flags } = await this.parse(Repo);
|
|
26
20
|
// Check if JSON output mode is active
|
|
27
21
|
const jsonMode = shouldOutputJson(flags);
|
|
28
|
-
// Define choices
|
|
22
|
+
// Define choices for both modes
|
|
29
23
|
const menuChoices = [
|
|
30
|
-
{ name: 'List all repositories', value: 'list' },
|
|
31
|
-
{ name: 'Add repository', value: 'add' },
|
|
32
|
-
{ name: 'Remove repository', value: 'remove' },
|
|
33
|
-
{ name: 'View repository details', value: 'view' },
|
|
34
|
-
{ name: 'Add multiple repositories', value: 'add-bulk' },
|
|
35
|
-
{ name: 'Remove multiple repositories', value: 'remove-bulk' },
|
|
36
|
-
{ name: 'Cancel', value: 'cancel' },
|
|
24
|
+
{ name: 'List all repositories', value: 'list', command: 'prlt repo list --json' },
|
|
25
|
+
{ name: 'Add repository', value: 'add', command: 'prlt repo add --json' },
|
|
26
|
+
{ name: 'Remove repository', value: 'remove', command: 'prlt repo remove --json' },
|
|
27
|
+
{ name: 'View repository details', value: 'view', command: 'prlt repo view --json' },
|
|
28
|
+
{ name: 'Add multiple repositories', value: 'add-bulk', command: 'prlt repo add --bulk --json' },
|
|
29
|
+
{ name: 'Remove multiple repositories', value: 'remove-bulk', command: 'prlt repo remove --bulk --json' },
|
|
37
30
|
];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return;
|
|
31
|
+
// Only show header in interactive mode
|
|
32
|
+
if (!jsonMode) {
|
|
33
|
+
this.log(colors.primary('📦 Repository Operations'));
|
|
34
|
+
this.log('');
|
|
43
35
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const { action } = await
|
|
36
|
+
// Use prompt for JSON mode support
|
|
37
|
+
const agentConfig = jsonMode ? { flags, commandName: 'repo' } : null;
|
|
38
|
+
const { action } = await this.prompt([{
|
|
47
39
|
type: 'list',
|
|
48
40
|
name: 'action',
|
|
49
|
-
message,
|
|
50
|
-
choices:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{ name: '🗑️ ' + menuChoices[2].name, value: menuChoices[2].value },
|
|
55
|
-
{ name: '📄 ' + menuChoices[3].name, value: menuChoices[3].value },
|
|
56
|
-
new inquirer.Separator('─── Bulk Operations ───'),
|
|
57
|
-
{ name: '📦 ' + menuChoices[4].name, value: menuChoices[4].value },
|
|
58
|
-
{ name: '🗑️ ' + menuChoices[5].name, value: menuChoices[5].value },
|
|
59
|
-
new inquirer.Separator(),
|
|
60
|
-
{ name: '❌ ' + menuChoices[6].name, value: menuChoices[6].value }
|
|
61
|
-
]
|
|
62
|
-
}]);
|
|
63
|
-
if (action === 'cancel') {
|
|
41
|
+
message: 'What would you like to do?',
|
|
42
|
+
choices: menuChoices,
|
|
43
|
+
}], agentConfig);
|
|
44
|
+
// In JSON mode, prompt exits after outputting - this is never reached
|
|
45
|
+
if (!action || action === 'cancel') {
|
|
64
46
|
this.log(colors.textMuted('Operation cancelled.'));
|
|
65
47
|
return;
|
|
66
48
|
}
|
|
@@ -4,6 +4,8 @@ export default class List extends PMOCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
format: import("@oclif/core/interfaces").OptionFlag<string, 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(): {
|
|
@@ -9,6 +9,7 @@ export default class Remove extends PMOCommand {
|
|
|
9
9
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
'keep-files': 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
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
|
-
import inquirer from 'inquirer';
|
|
4
3
|
import { colors, format } from '../../lib/colors.js';
|
|
5
|
-
import { findHQRoot,
|
|
6
|
-
import { shouldOutputJson,
|
|
4
|
+
import { findHQRoot, removeRepository, getWorkspaceRepoInfo } from '../../lib/repos/index.js';
|
|
5
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
7
6
|
export default class Remove extends PMOCommand {
|
|
8
7
|
static description = 'Remove a repository from the HQ';
|
|
9
8
|
static examples = [
|
|
@@ -34,10 +33,6 @@ export default class Remove extends PMOCommand {
|
|
|
34
33
|
description: 'Remove multiple repositories interactively',
|
|
35
34
|
default: false,
|
|
36
35
|
}),
|
|
37
|
-
json: Flags.boolean({
|
|
38
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
39
|
-
default: false,
|
|
40
|
-
}),
|
|
41
36
|
};
|
|
42
37
|
getPMOOptions() {
|
|
43
38
|
return { promptIfMultiple: false };
|
|
@@ -71,28 +66,20 @@ export default class Remove extends PMOCommand {
|
|
|
71
66
|
if (repositories.length === 0) {
|
|
72
67
|
return handleError('NO_REPOSITORIES', 'No repositories found.');
|
|
73
68
|
}
|
|
74
|
-
//
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
const { selected } = await inquirer.prompt([{
|
|
86
|
-
type: 'list',
|
|
87
|
-
name: 'selected',
|
|
88
|
-
message: selectMessage,
|
|
89
|
-
choices: repoChoices,
|
|
90
|
-
}]);
|
|
91
|
-
repoName = selected;
|
|
92
|
-
if (!repoName) {
|
|
69
|
+
// Use selectFromList helper for JSON mode support
|
|
70
|
+
const selected = await this.selectFromList({
|
|
71
|
+
message: 'Select repository to remove:',
|
|
72
|
+
items: repositories,
|
|
73
|
+
getName: (r) => r.name,
|
|
74
|
+
getValue: (r) => r.name,
|
|
75
|
+
getCommand: (r) => `prlt repo remove ${r.name} --json`,
|
|
76
|
+
jsonMode: jsonMode ? { flags, commandName: 'repo remove' } : null,
|
|
77
|
+
});
|
|
78
|
+
if (!selected) {
|
|
93
79
|
this.log(colors.textMuted('Operation cancelled.'));
|
|
94
80
|
return;
|
|
95
81
|
}
|
|
82
|
+
repoName = selected;
|
|
96
83
|
}
|
|
97
84
|
// Validate repository exists
|
|
98
85
|
const { repositories } = getWorkspaceRepoInfo();
|
|
@@ -102,32 +89,21 @@ export default class Remove extends PMOCommand {
|
|
|
102
89
|
}
|
|
103
90
|
// Confirmation unless --force
|
|
104
91
|
if (!flags.force) {
|
|
105
|
-
|
|
106
|
-
const confirmChoices = [
|
|
107
|
-
{ name: 'No, cancel', value: 'false' },
|
|
108
|
-
{ name: 'Yes, remove repository', value: 'true' },
|
|
109
|
-
];
|
|
110
|
-
const confirmMessage = `Remove repository "${repoName}"? (This will remove repos/${repoName} directory and agent worktrees)`;
|
|
111
|
-
// In JSON mode, output confirmation prompt
|
|
112
|
-
if (jsonMode) {
|
|
113
|
-
outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('repo remove', flags));
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
92
|
+
const agentConfig = jsonMode ? { flags, commandName: 'repo remove' } : null;
|
|
116
93
|
this.log(colors.warning('\n⚠️ This will:'));
|
|
117
94
|
this.log(colors.text(` • Remove repos/${repoName} directory`));
|
|
118
95
|
this.log(colors.text(' • Remove agent worktrees for this repo'));
|
|
119
96
|
this.log(colors.text(' • Update database\n'));
|
|
120
|
-
const { confirm } = await
|
|
97
|
+
const { confirm } = await this.prompt([{
|
|
121
98
|
type: 'list',
|
|
122
99
|
name: 'confirm',
|
|
123
100
|
message: `Are you sure you want to remove "${repoName}"?`,
|
|
124
101
|
choices: [
|
|
125
|
-
{ name: '
|
|
126
|
-
{ name: '
|
|
102
|
+
{ name: 'No, cancel', value: 'false', command: '' },
|
|
103
|
+
{ name: 'Yes, remove repository', value: 'true', command: `prlt repo remove ${repoName} --force --json` },
|
|
127
104
|
],
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (!confirm) {
|
|
105
|
+
}], agentConfig);
|
|
106
|
+
if (confirm !== 'true') {
|
|
131
107
|
this.log(colors.textMuted('Removal cancelled.'));
|
|
132
108
|
return;
|
|
133
109
|
}
|
|
@@ -146,24 +122,31 @@ export default class Remove extends PMOCommand {
|
|
|
146
122
|
* Bulk mode: remove multiple repositories interactively
|
|
147
123
|
*/
|
|
148
124
|
async executeBulk(hqPath, force, keepFiles, jsonMode = false, flags = {}) {
|
|
149
|
-
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
if (repositories.length === 0) {
|
|
125
|
+
const { repositories } = getWorkspaceRepoInfo();
|
|
126
|
+
if (repositories.length === 0) {
|
|
127
|
+
if (jsonMode) {
|
|
153
128
|
outputErrorAsJson('NO_REPOSITORIES', 'No repositories found.', createMetadata('repo remove', flags));
|
|
154
129
|
this.exit(1);
|
|
155
130
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return;
|
|
131
|
+
this.error('No repositories found.');
|
|
132
|
+
}
|
|
133
|
+
// Only show header in interactive mode
|
|
134
|
+
if (!jsonMode) {
|
|
135
|
+
this.log(colors.primary('📦 Remove Repositories (Bulk Mode)\n'));
|
|
162
136
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const selectedRepos = await
|
|
166
|
-
|
|
137
|
+
// Use prompt for JSON mode support
|
|
138
|
+
const agentConfig = jsonMode ? { flags, commandName: 'repo remove --bulk' } : null;
|
|
139
|
+
const { selectedRepos } = await this.prompt([{
|
|
140
|
+
type: 'checkbox',
|
|
141
|
+
name: 'selectedRepos',
|
|
142
|
+
message: 'Select repositories to remove:',
|
|
143
|
+
choices: repositories.map(r => ({
|
|
144
|
+
name: r.name,
|
|
145
|
+
value: r.name,
|
|
146
|
+
command: `prlt repo remove ${r.name} --json`,
|
|
147
|
+
})),
|
|
148
|
+
}], agentConfig);
|
|
149
|
+
if (!selectedRepos || selectedRepos.length === 0) {
|
|
167
150
|
this.log(colors.textMuted('No repositories selected.'));
|
|
168
151
|
return;
|
|
169
152
|
}
|
|
@@ -174,17 +157,16 @@ export default class Remove extends PMOCommand {
|
|
|
174
157
|
this.log(colors.text(` • repos/${name}`));
|
|
175
158
|
}
|
|
176
159
|
this.log(colors.text(' • Agent worktrees for these repos\n'));
|
|
177
|
-
const { confirm } = await
|
|
160
|
+
const { confirm } = await this.prompt([{
|
|
178
161
|
type: 'list',
|
|
179
162
|
name: 'confirm',
|
|
180
163
|
message: 'Are you sure?',
|
|
181
164
|
choices: [
|
|
182
|
-
{ name: '
|
|
183
|
-
{ name: '
|
|
165
|
+
{ name: 'No, cancel', value: 'false', command: '' },
|
|
166
|
+
{ name: 'Yes, remove repositories', value: 'true', command: `prlt repo remove ${selectedRepos.join(' ')} --force --json` },
|
|
184
167
|
],
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if (!confirm) {
|
|
168
|
+
}], agentConfig);
|
|
169
|
+
if (confirm !== 'true') {
|
|
188
170
|
this.log(colors.textMuted('Removal cancelled.'));
|
|
189
171
|
return;
|
|
190
172
|
}
|
|
@@ -6,6 +6,8 @@ export default class View 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(): {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
3
3
|
import { colors, format } from '../../lib/colors.js';
|
|
4
|
-
import { findHQRoot,
|
|
4
|
+
import { findHQRoot, getWorkspaceRepoInfo, } from '../../lib/repos/index.js';
|
|
5
5
|
import { openWorkspaceDatabase } from '../../lib/database/index.js';
|
|
6
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
6
7
|
export default class View extends PMOCommand {
|
|
7
8
|
static description = 'View detailed information about a repository';
|
|
8
9
|
static examples = [
|
|
@@ -22,20 +23,44 @@ export default class View extends PMOCommand {
|
|
|
22
23
|
return { promptIfMultiple: false };
|
|
23
24
|
}
|
|
24
25
|
async execute() {
|
|
25
|
-
const { args } = await this.parse(View);
|
|
26
|
+
const { args, flags } = await this.parse(View);
|
|
27
|
+
// Check if JSON output mode is active
|
|
28
|
+
const jsonMode = shouldOutputJson(flags);
|
|
29
|
+
// Helper to handle errors in JSON mode
|
|
30
|
+
const handleError = (code, message) => {
|
|
31
|
+
if (jsonMode) {
|
|
32
|
+
outputErrorAsJson(code, message, createMetadata('repo view', flags));
|
|
33
|
+
this.exit(1);
|
|
34
|
+
}
|
|
35
|
+
this.error(message);
|
|
36
|
+
};
|
|
26
37
|
// Find HQ root
|
|
27
38
|
const hqPath = findHQRoot();
|
|
28
39
|
if (!hqPath) {
|
|
29
|
-
|
|
40
|
+
return handleError('NOT_IN_HQ', 'Not in an HQ directory. Run "prlt init" first.');
|
|
30
41
|
}
|
|
31
42
|
let repoName = args.name || null;
|
|
32
43
|
// Interactive selection if no name provided
|
|
33
44
|
if (!repoName) {
|
|
34
|
-
|
|
35
|
-
if (
|
|
45
|
+
const { repositories } = getWorkspaceRepoInfo();
|
|
46
|
+
if (repositories.length === 0) {
|
|
47
|
+
return handleError('NO_REPOSITORIES', 'No repositories found. Add one with "prlt repo add"');
|
|
48
|
+
}
|
|
49
|
+
// Use selectFromList helper for JSON mode support
|
|
50
|
+
const selected = await this.selectFromList({
|
|
51
|
+
message: 'Select repository to view:',
|
|
52
|
+
items: repositories,
|
|
53
|
+
getName: (r) => `${r.name} (${r.status}${r.commitsAhead > 0 ? `, ${r.commitsAhead} ahead` : ''})`,
|
|
54
|
+
getValue: (r) => r.name,
|
|
55
|
+
getCommand: (r) => `prlt repo view ${r.name} --json`,
|
|
56
|
+
jsonMode: jsonMode ? { flags, commandName: 'repo view' } : null,
|
|
57
|
+
allowCancel: true,
|
|
58
|
+
});
|
|
59
|
+
if (!selected) {
|
|
36
60
|
this.log(colors.textMuted('Operation cancelled.'));
|
|
37
61
|
return;
|
|
38
62
|
}
|
|
63
|
+
repoName = selected;
|
|
39
64
|
}
|
|
40
65
|
// Get repository info
|
|
41
66
|
const { repositories } = getWorkspaceRepoInfo();
|
|
@@ -9,6 +9,7 @@ export default class RoadmapAddProject extends PMOCommand {
|
|
|
9
9
|
static flags: {
|
|
10
10
|
position: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
json: 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
|
protected getPMOOptions(): {
|
|
@@ -12,6 +12,7 @@ export default class RoadmapCreate extends PMOCommand {
|
|
|
12
12
|
default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
};
|
|
17
18
|
protected getPMOOptions(): {
|
|
@@ -8,6 +8,7 @@ export default class RoadmapDelete extends PMOCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
machine: 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
|
protected getPMOOptions(): {
|
|
@@ -9,6 +9,7 @@ export default class RoadmapGenerate extends PMOCommand {
|
|
|
9
9
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
json: 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
|
protected getPMOOptions(): {
|
|
@@ -4,6 +4,7 @@ export default class Roadmap 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(): {
|
|
@@ -3,6 +3,8 @@ export default class RoadmapList extends PMOCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
8
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
9
|
};
|
|
8
10
|
protected getPMOOptions(): {
|
|
@@ -9,6 +9,7 @@ export default class RoadmapRemoveProject extends PMOCommand {
|
|
|
9
9
|
static flags: {
|
|
10
10
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
json: 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
|
protected getPMOOptions(): {
|
|
@@ -9,6 +9,7 @@ export default class RoadmapReorder extends PMOCommand {
|
|
|
9
9
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
position: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
};
|
|
13
14
|
protected getPMOOptions(): {
|
|
14
15
|
promptIfMultiple: boolean;
|
|
@@ -10,6 +10,7 @@ export default class RoadmapUpdate extends PMOCommand {
|
|
|
10
10
|
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
15
16
|
protected getPMOOptions(): {
|
|
@@ -7,6 +7,7 @@ export default class RoadmapView 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(): {
|
|
@@ -10,6 +10,7 @@ export default class SessionAttach extends PMOCommand {
|
|
|
10
10
|
'new-tab': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
'current-terminal': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
terminal: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
15
16
|
protected getPMOOptions(): {
|
|
@@ -4,6 +4,7 @@ export default class Session 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(): {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
2
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
4
|
-
import { shouldOutputJson
|
|
3
|
+
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
5
4
|
export default class Session extends PMOCommand {
|
|
6
5
|
static description = 'Manage agent tmux sessions (list, attach, detach)';
|
|
7
6
|
static examples = [
|
|
@@ -21,33 +20,17 @@ export default class Session extends PMOCommand {
|
|
|
21
20
|
}
|
|
22
21
|
async execute() {
|
|
23
22
|
const { flags } = await this.parse(Session);
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
// Define choices
|
|
27
|
-
const menuChoices = [
|
|
28
|
-
{ name: 'List active sessions', value: 'list' },
|
|
29
|
-
{ name: 'Attach to a session', value: 'attach' },
|
|
30
|
-
{ name: 'Cancel', value: 'cancel' },
|
|
31
|
-
];
|
|
32
|
-
const message = 'Session Management - What would you like to do?';
|
|
33
|
-
// In JSON mode, output menu prompt
|
|
34
|
-
if (jsonMode) {
|
|
35
|
-
outputPromptAsJson(buildPromptConfig('list', 'action', message, menuChoices), createMetadata('session', flags));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const { action } = await inquirer.prompt([
|
|
39
|
-
{
|
|
23
|
+
const jsonModeConfig = shouldOutputJson(flags) ? { flags, commandName: 'session' } : null;
|
|
24
|
+
const { action } = await this.prompt([{
|
|
40
25
|
type: 'list',
|
|
41
26
|
name: 'action',
|
|
42
|
-
message: '
|
|
27
|
+
message: 'Session Management - What would you like to do?',
|
|
43
28
|
choices: [
|
|
44
|
-
{ name: '
|
|
45
|
-
{ name: '
|
|
46
|
-
|
|
47
|
-
{ name: '❌ ' + menuChoices[2].name, value: menuChoices[2].value },
|
|
29
|
+
{ name: 'List active sessions', value: 'list', command: 'prlt session list --json' },
|
|
30
|
+
{ name: 'Attach to a session', value: 'attach', command: 'prlt session attach --json' },
|
|
31
|
+
{ name: 'Cancel', value: 'cancel' },
|
|
48
32
|
],
|
|
49
|
-
},
|
|
50
|
-
]);
|
|
33
|
+
}], jsonModeConfig);
|
|
51
34
|
if (action === 'cancel') {
|
|
52
35
|
return;
|
|
53
36
|
}
|
|
@@ -4,6 +4,8 @@ export default class SessionList extends PMOCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
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(): {
|
|
@@ -11,9 +11,9 @@ export default class SpecCreate extends PMOCommand {
|
|
|
11
11
|
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
problem: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
};
|
|
17
18
|
execute(): Promise<void>;
|
|
18
|
-
private promptSpecData;
|
|
19
19
|
}
|