@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.
Files changed (338) hide show
  1. package/dist/commands/action/create.d.ts +1 -0
  2. package/dist/commands/action/create.js +74 -38
  3. package/dist/commands/action/delete.d.ts +1 -0
  4. package/dist/commands/action/delete.js +23 -24
  5. package/dist/commands/action/index.d.ts +1 -0
  6. package/dist/commands/action/index.js +5 -10
  7. package/dist/commands/action/list.d.ts +1 -0
  8. package/dist/commands/action/list.js +3 -1
  9. package/dist/commands/action/run.d.ts +1 -0
  10. package/dist/commands/action/run.js +44 -32
  11. package/dist/commands/action/show.d.ts +2 -0
  12. package/dist/commands/action/update.d.ts +1 -0
  13. package/dist/commands/action/update.js +80 -39
  14. package/dist/commands/agent/auth.d.ts +2 -0
  15. package/dist/commands/agent/auth.js +44 -3
  16. package/dist/commands/agent/discover.d.ts +2 -0
  17. package/dist/commands/agent/discover.js +35 -3
  18. package/dist/commands/agent/index.d.ts +1 -0
  19. package/dist/commands/agent/index.js +25 -45
  20. package/dist/commands/agent/list.d.ts +8 -3
  21. package/dist/commands/agent/list.js +16 -29
  22. package/dist/commands/agent/login.d.ts +1 -0
  23. package/dist/commands/agent/login.js +14 -32
  24. package/dist/commands/agent/rebuild.d.ts +1 -0
  25. package/dist/commands/agent/rebuild.js +2 -2
  26. package/dist/commands/agent/remove.d.ts +17 -0
  27. package/dist/commands/agent/remove.js +144 -0
  28. package/dist/commands/agent/restart.d.ts +1 -0
  29. package/dist/commands/agent/restart.js +2 -2
  30. package/dist/commands/agent/shell.d.ts +1 -0
  31. package/dist/commands/agent/shell.js +63 -76
  32. package/dist/commands/agent/staff/add.d.ts +1 -0
  33. package/dist/commands/agent/staff/add.js +7 -1
  34. package/dist/commands/agent/staff/index.d.ts +1 -0
  35. package/dist/commands/agent/staff/index.js +5 -4
  36. package/dist/commands/agent/staff/remove.d.ts +1 -0
  37. package/dist/commands/agent/status.d.ts +1 -0
  38. package/dist/commands/agent/status.js +11 -23
  39. package/dist/commands/agent/temp/cleanup.d.ts +1 -0
  40. package/dist/commands/agent/temp/index.d.ts +1 -0
  41. package/dist/commands/agent/temp/index.js +4 -3
  42. package/dist/commands/agent/themes/index.d.ts +1 -0
  43. package/dist/commands/agent/themes/index.js +9 -3
  44. package/dist/commands/agent/themes/set.d.ts +1 -0
  45. package/dist/commands/agent/themes/set.js +7 -1
  46. package/dist/commands/agent/visit.d.ts +1 -0
  47. package/dist/commands/agent/visit.js +11 -23
  48. package/dist/commands/autocomplete/setup.d.ts +11 -0
  49. package/dist/commands/autocomplete/setup.js +113 -8
  50. package/dist/commands/board/index.d.ts +4 -0
  51. package/dist/commands/board/index.js +32 -30
  52. package/dist/commands/board/watch.d.ts +2 -0
  53. package/dist/commands/branch/create.d.ts +1 -0
  54. package/dist/commands/branch/create.js +33 -41
  55. package/dist/commands/branch/index.d.ts +1 -0
  56. package/dist/commands/branch/list.d.ts +2 -0
  57. package/dist/commands/branch/validate.d.ts +2 -0
  58. package/dist/commands/branch/where.d.ts +1 -0
  59. package/dist/commands/claude.d.ts +6 -0
  60. package/dist/commands/claude.js +166 -116
  61. package/dist/commands/commit.d.ts +6 -0
  62. package/dist/commands/commit.js +68 -73
  63. package/dist/commands/config/index.d.ts +13 -0
  64. package/dist/commands/config/index.js +142 -98
  65. package/dist/commands/docker/clean.d.ts +2 -1
  66. package/dist/commands/docker/clean.js +20 -29
  67. package/dist/commands/docker/index.d.ts +1 -0
  68. package/dist/commands/docker/index.js +37 -41
  69. package/dist/commands/docker/prune.d.ts +2 -1
  70. package/dist/commands/docker/prune.js +20 -27
  71. package/dist/commands/docker/restart.d.ts +2 -1
  72. package/dist/commands/docker/restart.js +20 -29
  73. package/dist/commands/docker/stop.d.ts +2 -1
  74. package/dist/commands/docker/stop.js +20 -29
  75. package/dist/commands/epic/activate.d.ts +1 -0
  76. package/dist/commands/epic/archive.d.ts +1 -0
  77. package/dist/commands/epic/create.d.ts +1 -0
  78. package/dist/commands/epic/index.d.ts +1 -0
  79. package/dist/commands/epic/link/block.d.ts +1 -0
  80. package/dist/commands/epic/link/duplicates.d.ts +1 -0
  81. package/dist/commands/epic/link/index.d.ts +1 -0
  82. package/dist/commands/epic/link/relates.d.ts +1 -0
  83. package/dist/commands/epic/link/remove.d.ts +1 -0
  84. package/dist/commands/epic/list.d.ts +2 -0
  85. package/dist/commands/epic/move.d.ts +1 -0
  86. package/dist/commands/epic/progress.d.ts +1 -0
  87. package/dist/commands/epic/project.d.ts +1 -0
  88. package/dist/commands/epic/reorder.d.ts +1 -0
  89. package/dist/commands/epic/spec.d.ts +1 -0
  90. package/dist/commands/epic/ticket.d.ts +1 -0
  91. package/dist/commands/epic/view.d.ts +1 -0
  92. package/dist/commands/execution/index.d.ts +1 -0
  93. package/dist/commands/execution/index.js +9 -25
  94. package/dist/commands/execution/list.d.ts +2 -0
  95. package/dist/commands/execution/logs.d.ts +1 -0
  96. package/dist/commands/execution/logs.js +6 -16
  97. package/dist/commands/execution/stop.d.ts +1 -0
  98. package/dist/commands/execution/stop.js +4 -15
  99. package/dist/commands/gh/index.d.ts +1 -0
  100. package/dist/commands/gh/index.js +27 -27
  101. package/dist/commands/gh/login.d.ts +4 -0
  102. package/dist/commands/gh/login.js +31 -0
  103. package/dist/commands/gh/status.d.ts +4 -0
  104. package/dist/commands/gh/status.js +27 -4
  105. package/dist/commands/gh/token.d.ts +4 -0
  106. package/dist/commands/gh/token.js +49 -5
  107. package/dist/commands/phase/create.d.ts +1 -1
  108. package/dist/commands/phase/create.js +116 -74
  109. package/dist/commands/phase/delete.d.ts +1 -0
  110. package/dist/commands/phase/delete.js +23 -22
  111. package/dist/commands/phase/list.d.ts +1 -0
  112. package/dist/commands/phase/list.js +3 -5
  113. package/dist/commands/phase/move.d.ts +1 -0
  114. package/dist/commands/phase/move.js +39 -39
  115. package/dist/commands/phase/template/apply.d.ts +1 -0
  116. package/dist/commands/phase/template/create.d.ts +2 -0
  117. package/dist/commands/phase/template/delete.d.ts +1 -0
  118. package/dist/commands/phase/template/index.d.ts +1 -0
  119. package/dist/commands/phase/template/list.d.ts +1 -0
  120. package/dist/commands/phase/template/update.d.ts +2 -0
  121. package/dist/commands/phase/update.d.ts +1 -1
  122. package/dist/commands/phase/update.js +89 -55
  123. package/dist/commands/pmo/init.d.ts +2 -0
  124. package/dist/commands/pmo/init.js +84 -22
  125. package/dist/commands/pr/create.d.ts +12 -3
  126. package/dist/commands/pr/create.js +130 -147
  127. package/dist/commands/pr/index.d.ts +6 -3
  128. package/dist/commands/pr/index.js +41 -39
  129. package/dist/commands/pr/link.d.ts +7 -3
  130. package/dist/commands/pr/link.js +126 -150
  131. package/dist/commands/pr/status.d.ts +6 -3
  132. package/dist/commands/pr/status.js +101 -126
  133. package/dist/commands/project/archive.d.ts +1 -0
  134. package/dist/commands/project/archive.js +15 -20
  135. package/dist/commands/project/create.d.ts +1 -0
  136. package/dist/commands/project/create.js +13 -5
  137. package/dist/commands/project/delete.d.ts +1 -0
  138. package/dist/commands/project/delete.js +14 -28
  139. package/dist/commands/project/index.d.ts +1 -0
  140. package/dist/commands/project/index.js +0 -5
  141. package/dist/commands/project/list.d.ts +2 -0
  142. package/dist/commands/project/list.js +21 -3
  143. package/dist/commands/project/spec.d.ts +1 -0
  144. package/dist/commands/project/spec.js +17 -23
  145. package/dist/commands/project/unarchive.d.ts +2 -0
  146. package/dist/commands/project/unarchive.js +21 -2
  147. package/dist/commands/project/view.d.ts +1 -0
  148. package/dist/commands/project/view.js +34 -22
  149. package/dist/commands/repo/add.d.ts +2 -0
  150. package/dist/commands/repo/add.js +44 -1
  151. package/dist/commands/repo/index.d.ts +1 -0
  152. package/dist/commands/repo/index.js +20 -38
  153. package/dist/commands/repo/list.d.ts +2 -0
  154. package/dist/commands/repo/remove.d.ts +1 -0
  155. package/dist/commands/repo/remove.js +45 -63
  156. package/dist/commands/repo/view.d.ts +2 -0
  157. package/dist/commands/repo/view.js +30 -5
  158. package/dist/commands/roadmap/add-project.d.ts +1 -0
  159. package/dist/commands/roadmap/create.d.ts +1 -0
  160. package/dist/commands/roadmap/delete.d.ts +1 -0
  161. package/dist/commands/roadmap/generate.d.ts +1 -0
  162. package/dist/commands/roadmap/index.d.ts +1 -0
  163. package/dist/commands/roadmap/list.d.ts +2 -0
  164. package/dist/commands/roadmap/remove-project.d.ts +1 -0
  165. package/dist/commands/roadmap/reorder.d.ts +1 -0
  166. package/dist/commands/roadmap/update.d.ts +1 -0
  167. package/dist/commands/roadmap/view.d.ts +1 -0
  168. package/dist/commands/session/attach.d.ts +1 -0
  169. package/dist/commands/session/index.d.ts +1 -0
  170. package/dist/commands/session/index.js +8 -25
  171. package/dist/commands/session/list.d.ts +2 -0
  172. package/dist/commands/spec/create.d.ts +1 -1
  173. package/dist/commands/spec/create.js +64 -65
  174. package/dist/commands/spec/index.d.ts +1 -0
  175. package/dist/commands/spec/index.js +36 -22
  176. package/dist/commands/spec/link/depends.d.ts +1 -0
  177. package/dist/commands/spec/link/depends.js +6 -6
  178. package/dist/commands/spec/link/duplicates.d.ts +1 -0
  179. package/dist/commands/spec/link/duplicates.js +6 -6
  180. package/dist/commands/spec/link/index.d.ts +2 -1
  181. package/dist/commands/spec/link/index.js +0 -4
  182. package/dist/commands/spec/link/relates.d.ts +1 -0
  183. package/dist/commands/spec/link/relates.js +6 -6
  184. package/dist/commands/spec/link/remove.d.ts +2 -1
  185. package/dist/commands/spec/link/remove.js +6 -6
  186. package/dist/commands/spec/list.d.ts +2 -0
  187. package/dist/commands/spec/list.js +25 -0
  188. package/dist/commands/spec/plan.d.ts +2 -1
  189. package/dist/commands/spec/plan.js +19 -26
  190. package/dist/commands/spec/ticket.d.ts +2 -1
  191. package/dist/commands/spec/ticket.js +48 -34
  192. package/dist/commands/spec/view.d.ts +2 -1
  193. package/dist/commands/spec/view.js +25 -16
  194. package/dist/commands/status/create.d.ts +1 -1
  195. package/dist/commands/status/create.js +80 -64
  196. package/dist/commands/status/delete.d.ts +2 -1
  197. package/dist/commands/status/delete.js +26 -22
  198. package/dist/commands/status/index.d.ts +1 -0
  199. package/dist/commands/status/index.js +26 -19
  200. package/dist/commands/status/list.d.ts +1 -0
  201. package/dist/commands/status/list.js +12 -7
  202. package/dist/commands/status/move.d.ts +2 -1
  203. package/dist/commands/status/move.js +62 -61
  204. package/dist/commands/status/update.d.ts +2 -2
  205. package/dist/commands/status/update.js +110 -77
  206. package/dist/commands/template/delete.d.ts +1 -0
  207. package/dist/commands/template/delete.js +47 -48
  208. package/dist/commands/template/index.d.ts +1 -0
  209. package/dist/commands/template/index.js +26 -33
  210. package/dist/commands/template/list.d.ts +1 -0
  211. package/dist/commands/template/phase/create.d.ts +1 -0
  212. package/dist/commands/template/phase/create.js +6 -0
  213. package/dist/commands/template/phase/index.d.ts +1 -0
  214. package/dist/commands/template/phase/index.js +27 -26
  215. package/dist/commands/template/phase/update.d.ts +1 -0
  216. package/dist/commands/template/phase/update.js +6 -0
  217. package/dist/commands/template/ticket/index.d.ts +1 -0
  218. package/dist/commands/template/ticket/index.js +27 -26
  219. package/dist/commands/template/ticket/save.d.ts +1 -0
  220. package/dist/commands/template/ticket/save.js +6 -0
  221. package/dist/commands/terminal/title.d.ts +26 -0
  222. package/dist/commands/terminal/title.js +37 -3
  223. package/dist/commands/ticket/bulk.d.ts +1 -0
  224. package/dist/commands/ticket/complete.d.ts +1 -0
  225. package/dist/commands/ticket/complete.js +18 -14
  226. package/dist/commands/ticket/create.d.ts +1 -0
  227. package/dist/commands/ticket/create.js +45 -41
  228. package/dist/commands/ticket/delete.d.ts +1 -0
  229. package/dist/commands/ticket/delete.js +1 -1
  230. package/dist/commands/ticket/edit.d.ts +1 -0
  231. package/dist/commands/ticket/edit.js +1 -1
  232. package/dist/commands/ticket/epic.d.ts +1 -0
  233. package/dist/commands/ticket/epic.js +2 -2
  234. package/dist/commands/ticket/index.d.ts +1 -0
  235. package/dist/commands/ticket/link/block.d.ts +1 -0
  236. package/dist/commands/ticket/link/block.js +1 -1
  237. package/dist/commands/ticket/link/duplicates.d.ts +1 -0
  238. package/dist/commands/ticket/link/duplicates.js +1 -1
  239. package/dist/commands/ticket/link/index.d.ts +1 -0
  240. package/dist/commands/ticket/link/index.js +9 -8
  241. package/dist/commands/ticket/link/relates.d.ts +1 -0
  242. package/dist/commands/ticket/link/relates.js +1 -1
  243. package/dist/commands/ticket/link/remove.d.ts +1 -0
  244. package/dist/commands/ticket/link/remove.js +1 -1
  245. package/dist/commands/ticket/list.d.ts +2 -0
  246. package/dist/commands/ticket/move.d.ts +1 -0
  247. package/dist/commands/ticket/move.js +27 -19
  248. package/dist/commands/ticket/project.d.ts +1 -0
  249. package/dist/commands/ticket/project.js +3 -3
  250. package/dist/commands/ticket/reassign.d.ts +1 -0
  251. package/dist/commands/ticket/reassign.js +1 -1
  252. package/dist/commands/ticket/spec.d.ts +1 -0
  253. package/dist/commands/ticket/spec.js +3 -3
  254. package/dist/commands/ticket/status.d.ts +1 -0
  255. package/dist/commands/ticket/status.js +1 -1
  256. package/dist/commands/ticket/template/apply.d.ts +1 -0
  257. package/dist/commands/ticket/template/create.d.ts +2 -0
  258. package/dist/commands/ticket/template/delete.d.ts +1 -0
  259. package/dist/commands/ticket/template/index.d.ts +1 -0
  260. package/dist/commands/ticket/template/list.d.ts +1 -0
  261. package/dist/commands/ticket/template/save.d.ts +2 -0
  262. package/dist/commands/ticket/update.d.ts +1 -0
  263. package/dist/commands/ticket/update.js +1 -1
  264. package/dist/commands/ticket/view.d.ts +1 -0
  265. package/dist/commands/ticket/view.js +1 -1
  266. package/dist/commands/work/complete.d.ts +1 -0
  267. package/dist/commands/work/index.d.ts +1 -0
  268. package/dist/commands/work/ready.d.ts +1 -0
  269. package/dist/commands/work/revise.d.ts +1 -0
  270. package/dist/commands/work/spawn-all.d.ts +2 -0
  271. package/dist/commands/work/spawn-all.js +11 -4
  272. package/dist/commands/work/spawn.d.ts +1 -0
  273. package/dist/commands/work/spawn.js +261 -166
  274. package/dist/commands/work/start.d.ts +1 -0
  275. package/dist/commands/work/start.js +270 -189
  276. package/dist/commands/work/watch.d.ts +1 -0
  277. package/dist/commands/work/watch.js +63 -58
  278. package/dist/commands/workflow/create.d.ts +1 -0
  279. package/dist/commands/workflow/create.js +2 -4
  280. package/dist/commands/workflow/delete.d.ts +1 -0
  281. package/dist/commands/workflow/delete.js +21 -33
  282. package/dist/commands/workflow/index.d.ts +1 -0
  283. package/dist/commands/workflow/list.d.ts +1 -0
  284. package/dist/commands/workflow/list.js +3 -6
  285. package/dist/commands/workflow/switch.d.ts +2 -0
  286. package/dist/commands/workflow/switch.js +46 -21
  287. package/dist/commands/workflow/view.d.ts +1 -0
  288. package/dist/commands/workflow/view.js +18 -27
  289. package/dist/commands/workspace/remove.d.ts +2 -2
  290. package/dist/commands/workspace/remove.js +16 -21
  291. package/dist/commands/workspace/use.d.ts +2 -2
  292. package/dist/commands/workspace/use.js +12 -18
  293. package/dist/lib/agents/commands.d.ts +1 -1
  294. package/dist/lib/agents/commands.js +4 -4
  295. package/dist/lib/database/drizzle-schema.d.ts +5009 -0
  296. package/dist/lib/database/drizzle-schema.js +699 -0
  297. package/dist/lib/database/drizzle.d.ts +29 -0
  298. package/dist/lib/database/drizzle.js +37 -0
  299. package/dist/lib/database/index.d.ts +1 -0
  300. package/dist/lib/database/index.js +1 -1
  301. package/dist/lib/execution/config.d.ts +6 -0
  302. package/dist/lib/execution/config.js +31 -13
  303. package/dist/lib/execution/devcontainer.js +13 -7
  304. package/dist/lib/execution/runners.js +24 -7
  305. package/dist/lib/execution/spawner.js +19 -0
  306. package/dist/lib/flags/index.d.ts +4 -0
  307. package/dist/lib/flags/index.js +4 -0
  308. package/dist/lib/flags/resolver.d.ts +224 -0
  309. package/dist/lib/flags/resolver.js +313 -0
  310. package/dist/lib/pmo/base-command.d.ts +53 -3
  311. package/dist/lib/pmo/base-command.js +92 -13
  312. package/dist/lib/pmo/find-pmo.d.ts +1 -1
  313. package/dist/lib/pmo/find-pmo.js +4 -4
  314. package/dist/lib/pmo/index.d.ts +1 -1
  315. package/dist/lib/pmo/index.js +1 -1
  316. package/dist/lib/pmo/storage/helpers.js +2 -1
  317. package/dist/lib/pmo/storage/index.d.ts +9 -0
  318. package/dist/lib/pmo/storage/index.js +14 -0
  319. package/dist/lib/pmo/storage/projects.d.ts +28 -13
  320. package/dist/lib/pmo/storage/projects.js +110 -34
  321. package/dist/lib/pmo/storage/roadmaps.d.ts +2 -0
  322. package/dist/lib/pmo/storage/roadmaps.js +182 -111
  323. package/dist/lib/pmo/storage/specs.js +13 -16
  324. package/dist/lib/pmo/storage/subtasks.js +17 -2
  325. package/dist/lib/pmo/storage/tickets.d.ts +12 -2
  326. package/dist/lib/pmo/storage/tickets.js +63 -5
  327. package/dist/lib/pmo/storage/types.d.ts +7 -3
  328. package/dist/lib/pmo/storage/views.d.ts +12 -1
  329. package/dist/lib/pmo/storage/views.js +61 -6
  330. package/dist/lib/prompt-command.d.ts +90 -0
  331. package/dist/lib/prompt-command.js +102 -0
  332. package/dist/lib/prompt-json.d.ts +34 -4
  333. package/dist/lib/prompt-json.js +35 -3
  334. package/dist/lib/repos/index.js +15 -15
  335. package/dist/lib/workspace.d.ts +4 -3
  336. package/dist/lib/workspace.js +3 -3
  337. package/oclif.manifest.json +4610 -2997
  338. package/package.json +13 -5
@@ -1,4 +1,4 @@
1
- import { Command, Flags } from '@oclif/core';
1
+ import { Command } from '@oclif/core';
2
2
  import inquirer from 'inquirer';
3
3
  import { execSync } from 'node:child_process';
4
4
  import * as path from 'node:path';
@@ -7,7 +7,8 @@ import { styles } from '../../lib/styles.js';
7
7
  import { getWorkspaceInfo } from '../../lib/agents/commands.js';
8
8
  import { ExecutionStorage, ContainerStorage } from '../../lib/execution/storage.js';
9
9
  import { isDockerRunning } from '../../lib/execution/runners.js';
10
- import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
10
+ import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
11
+ import { machineOutputFlags } from '../../lib/pmo/base-command.js';
11
12
  export default class Docker extends Command {
12
13
  static description = 'Manage Docker containers used by agents';
13
14
  static examples = [
@@ -24,53 +25,48 @@ export default class Docker extends Command {
24
25
  '<%= config.bin %> docker prune',
25
26
  ];
26
27
  static flags = {
27
- json: Flags.boolean({
28
- description: 'Output prompt configuration as JSON (for AI agents/scripts)',
29
- default: false,
30
- }),
28
+ ...machineOutputFlags,
31
29
  };
32
30
  async run() {
33
31
  const { flags } = await this.parse(Docker);
34
- // Check if JSON output mode is active
35
32
  const jsonMode = shouldOutputJson(flags);
36
33
  // Define choices once, use for both JSON and interactive modes
37
34
  const menuChoices = [
38
- { name: 'Check Docker status', value: 'status' },
39
- { name: 'List containers', value: 'list' },
40
- { name: 'View container logs', value: 'logs' },
41
- { name: 'Start a container', value: 'start' },
42
- { name: 'Stop a container', value: 'stop' },
43
- { name: 'Shell into container', value: 'shell' },
44
- { name: 'Restart a container', value: 'restart' },
45
- { name: 'Sync containers from Docker', value: 'sync' },
46
- { name: 'Clean orphaned containers', value: 'clean' },
47
- { name: 'Prune unused resources', value: 'prune' },
48
- { name: 'Exit', value: 'exit' },
35
+ { name: 'Check Docker status', value: 'status', command: 'prlt docker status --json' },
36
+ { name: 'List containers', value: 'list', command: 'prlt docker list --json' },
37
+ { name: 'View container logs', value: 'logs', command: 'prlt docker logs <target> --json' },
38
+ { name: 'Start a container', value: 'start', command: 'prlt docker start <target> --json' },
39
+ { name: 'Stop a container', value: 'stop', command: 'prlt docker stop <target> --json' },
40
+ { name: 'Shell into container', value: 'shell', command: 'prlt docker shell <target> --json' },
41
+ { name: 'Restart a container', value: 'restart', command: 'prlt docker restart <target> --json' },
42
+ { name: 'Sync containers from Docker', value: 'sync', command: 'prlt docker sync --json' },
43
+ { name: 'Clean orphaned containers', value: 'clean', command: 'prlt docker clean --json' },
44
+ { name: 'Prune unused resources', value: 'prune', command: 'prlt docker prune --json' },
45
+ { name: 'Exit', value: 'exit', command: 'prlt docker --exit' },
49
46
  ];
50
- const message = 'What would you like to do?';
51
- // In JSON mode, output menu prompt
52
- if (jsonMode) {
53
- outputPromptAsJson(buildPromptConfig('list', 'action', message, menuChoices), createMetadata('docker', flags));
54
- return;
47
+ const resolver = new FlagResolver({
48
+ commandName: 'docker',
49
+ baseCommand: 'prlt docker',
50
+ jsonMode,
51
+ flags,
52
+ });
53
+ resolver.addPrompt({
54
+ flagName: 'action',
55
+ type: 'list',
56
+ message: 'What would you like to do?',
57
+ choices: () => menuChoices,
58
+ skipAutoCommand: true, // Use the custom commands defined above
59
+ });
60
+ // In JSON mode, this outputs prompt and exits
61
+ // In interactive mode, we need to show the header first
62
+ if (!jsonMode) {
63
+ this.log('');
64
+ this.log(styles.header('Docker Management'));
65
+ this.log('');
55
66
  }
56
- this.log('');
57
- this.log(styles.header('Docker Management'));
58
- this.log('');
59
- const { action } = await inquirer.prompt([
60
- {
61
- type: 'list',
62
- name: 'action',
63
- message,
64
- choices: [
65
- ...menuChoices.slice(0, 7),
66
- new inquirer.Separator(),
67
- ...menuChoices.slice(7, 10),
68
- new inquirer.Separator(),
69
- menuChoices[10],
70
- ],
71
- },
72
- ]);
73
- if (action === 'exit') {
67
+ const resolved = await resolver.resolve();
68
+ const action = resolved.action;
69
+ if (!action || action === 'exit') {
74
70
  return;
75
71
  }
76
72
  // Commands that require a target
@@ -3,11 +3,12 @@ export default class DockerPrune extends Command {
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
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
9
  'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
10
  all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
11
  volumes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
13
  run(): Promise<void>;
13
14
  private showPrunePreview;
@@ -1,9 +1,9 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
2
  import { execSync } from 'node:child_process';
3
- import inquirer from 'inquirer';
4
3
  import { styles } from '../../lib/styles.js';
5
4
  import { isDockerRunning } from '../../lib/execution/runners.js';
6
- import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
5
+ import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
6
+ import { machineOutputFlags } from '../../lib/pmo/base-command.js';
7
7
  export default class DockerPrune extends Command {
8
8
  static description = 'Remove unused Docker resources (containers, images, volumes, networks)';
9
9
  static examples = [
@@ -33,10 +33,7 @@ export default class DockerPrune extends Command {
33
33
  description: 'Also prune volumes (dangerous - data loss possible)',
34
34
  default: false,
35
35
  }),
36
- json: Flags.boolean({
37
- description: 'Output prompt configuration as JSON (for AI agents/scripts)',
38
- default: false,
39
- }),
36
+ ...machineOutputFlags,
40
37
  };
41
38
  async run() {
42
39
  const { flags } = await this.parse(DockerPrune);
@@ -79,30 +76,26 @@ export default class DockerPrune extends Command {
79
76
  }
80
77
  // Confirm
81
78
  if (!flags.force) {
82
- // Check if JSON output mode is active
83
- const jsonMode = shouldOutputJson(flags);
84
- // Build choices once, use for both JSON and interactive modes
85
- const confirmChoices = [
86
- { name: 'No', value: 'false' },
87
- { name: 'Yes', value: 'true' },
88
- ];
89
79
  const confirmMessage = flags.volumes
90
80
  ? 'This will remove unused resources INCLUDING VOLUMES. Data may be lost. Continue?'
91
81
  : 'Remove unused Docker resources?';
92
- // In JSON mode, output confirmation prompt
93
- if (jsonMode) {
94
- outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('docker prune', flags));
95
- return;
96
- }
97
- const { confirm } = await inquirer.prompt([
98
- {
99
- type: 'confirm',
100
- name: 'confirm',
101
- message: confirmMessage,
102
- default: false,
103
- },
104
- ]);
105
- if (!confirm) {
82
+ const resolver = new FlagResolver({
83
+ commandName: 'docker prune',
84
+ baseCommand: 'prlt docker prune',
85
+ jsonMode: shouldOutputJson(flags),
86
+ flags,
87
+ });
88
+ resolver.addPrompt({
89
+ flagName: 'confirmed',
90
+ type: 'list',
91
+ message: confirmMessage,
92
+ choices: () => [
93
+ { name: 'Yes', value: true },
94
+ { name: 'No', value: false },
95
+ ],
96
+ });
97
+ const resolved = await resolver.resolve();
98
+ if (!resolved.confirmed) {
106
99
  this.log(`${styles.muted('Aborted.')}\n`);
107
100
  return;
108
101
  }
@@ -3,9 +3,10 @@ export default class DockerRestart extends Command {
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
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
9
  time: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
10
  };
10
11
  static args: {
11
12
  target: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -2,13 +2,13 @@ import { Args, Command, Flags } from '@oclif/core';
2
2
  import { execSync } from 'node:child_process';
3
3
  import * as path from 'node:path';
4
4
  import Database from 'better-sqlite3';
5
- import inquirer from 'inquirer';
6
5
  import { styles } from '../../lib/styles.js';
7
6
  import { getWorkspaceInfo } from '../../lib/agents/commands.js';
8
7
  import { ExecutionStorage } from '../../lib/execution/storage.js';
9
8
  import { isDockerRunning } from '../../lib/execution/runners.js';
10
9
  import { resolveContainerId, containerExists, sanitizeContainerId } from '../../lib/docker/resolve.js';
11
- import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
10
+ import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
11
+ import { machineOutputFlags } from '../../lib/pmo/base-command.js';
12
12
  export default class DockerRestart extends Command {
13
13
  static description = 'Restart a container (by execution ID, agent name, or container ID)';
14
14
  static examples = [
@@ -28,10 +28,7 @@ export default class DockerRestart extends Command {
28
28
  description: 'Seconds to wait before killing the container during stop',
29
29
  default: 10,
30
30
  }),
31
- json: Flags.boolean({
32
- description: 'Output prompt configuration as JSON (for AI agents/scripts)',
33
- default: false,
34
- }),
31
+ ...machineOutputFlags,
35
32
  };
36
33
  static args = {
37
34
  target: Args.string({
@@ -78,29 +75,23 @@ export default class DockerRestart extends Command {
78
75
  this.log(styles.muted(`Container: ${result.containerId.substring(0, 12)}\n`));
79
76
  // Confirm
80
77
  if (!flags.force) {
81
- // Check if JSON output mode is active
82
- const jsonMode = shouldOutputJson(flags);
83
- // Build choices once, use for both JSON and interactive modes
84
- const confirmChoices = [
85
- { name: 'Yes', value: 'true' },
86
- { name: 'No', value: 'false' },
87
- ];
88
- const confirmMessage = `Restart container ${result.displayName}?`;
89
- // In JSON mode, output confirmation prompt
90
- if (jsonMode) {
91
- outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('docker restart', flags));
92
- db.close();
93
- return;
94
- }
95
- const { confirm } = await inquirer.prompt([
96
- {
97
- type: 'confirm',
98
- name: 'confirm',
99
- message: confirmMessage,
100
- default: true,
101
- },
102
- ]);
103
- if (!confirm) {
78
+ const resolver = new FlagResolver({
79
+ commandName: 'docker restart',
80
+ baseCommand: `prlt docker restart ${args.target}`,
81
+ jsonMode: shouldOutputJson(flags),
82
+ flags,
83
+ });
84
+ resolver.addPrompt({
85
+ flagName: 'confirmed',
86
+ type: 'list',
87
+ message: `Restart container ${result.displayName}?`,
88
+ choices: () => [
89
+ { name: 'Yes', value: true },
90
+ { name: 'No', value: false },
91
+ ],
92
+ });
93
+ const resolved = await resolver.resolve();
94
+ if (!resolved.confirmed) {
104
95
  this.log(`${styles.muted('Aborted.')}\n`);
105
96
  db.close();
106
97
  return;
@@ -3,9 +3,10 @@ export default class DockerStop extends Command {
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
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
9
  time: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
10
  };
10
11
  static args: {
11
12
  target: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
@@ -2,13 +2,13 @@ import { Args, Command, Flags } from '@oclif/core';
2
2
  import { execSync } from 'node:child_process';
3
3
  import * as path from 'node:path';
4
4
  import Database from 'better-sqlite3';
5
- import inquirer from 'inquirer';
6
5
  import { styles } from '../../lib/styles.js';
7
6
  import { getWorkspaceInfo } from '../../lib/agents/commands.js';
8
7
  import { ExecutionStorage } from '../../lib/execution/storage.js';
9
8
  import { isDockerRunning } from '../../lib/execution/runners.js';
10
9
  import { resolveContainerId, isContainerRunning, sanitizeContainerId } from '../../lib/docker/resolve.js';
11
- import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
10
+ import { FlagResolver, shouldOutputJson } from '../../lib/flags/index.js';
11
+ import { machineOutputFlags } from '../../lib/pmo/base-command.js';
12
12
  export default class DockerStop extends Command {
13
13
  static description = 'Stop a running container (by execution ID, agent name, or container ID)';
14
14
  static examples = [
@@ -28,10 +28,7 @@ export default class DockerStop extends Command {
28
28
  description: 'Seconds to wait before killing the container',
29
29
  default: 10,
30
30
  }),
31
- json: Flags.boolean({
32
- description: 'Output prompt configuration as JSON (for AI agents/scripts)',
33
- default: false,
34
- }),
31
+ ...machineOutputFlags,
35
32
  };
36
33
  static args = {
37
34
  target: Args.string({
@@ -79,29 +76,23 @@ export default class DockerStop extends Command {
79
76
  this.log(styles.muted(`Container: ${result.containerId.substring(0, 12)}\n`));
80
77
  // Confirm
81
78
  if (!flags.force) {
82
- // Check if JSON output mode is active
83
- const jsonMode = shouldOutputJson(flags);
84
- // Build choices once, use for both JSON and interactive modes
85
- const confirmChoices = [
86
- { name: 'No', value: 'false' },
87
- { name: 'Yes', value: 'true' },
88
- ];
89
- const confirmMessage = `Stop container ${result.displayName}?`;
90
- // In JSON mode, output confirmation prompt
91
- if (jsonMode) {
92
- outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('docker stop', flags));
93
- db.close();
94
- return;
95
- }
96
- const { confirm } = await inquirer.prompt([
97
- {
98
- type: 'confirm',
99
- name: 'confirm',
100
- message: confirmMessage,
101
- default: false,
102
- },
103
- ]);
104
- if (!confirm) {
79
+ const resolver = new FlagResolver({
80
+ commandName: 'docker stop',
81
+ baseCommand: `prlt docker stop ${args.target}`,
82
+ jsonMode: shouldOutputJson(flags),
83
+ flags,
84
+ });
85
+ resolver.addPrompt({
86
+ flagName: 'confirmed',
87
+ type: 'list',
88
+ message: `Stop container ${result.displayName}?`,
89
+ choices: () => [
90
+ { name: 'Yes', value: true },
91
+ { name: 'No', value: false },
92
+ ],
93
+ });
94
+ const resolved = await resolver.resolve();
95
+ if (!resolved.confirmed) {
105
96
  this.log(`${styles.muted('Aborted.')}\n`);
106
97
  db.close();
107
98
  return;
@@ -7,6 +7,7 @@ export default class EpicActivate 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
  execute(): Promise<void>;
@@ -8,6 +8,7 @@ export default class EpicArchive extends PMOCommand {
8
8
  static flags: {
9
9
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  force: 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
  execute(): Promise<void>;
@@ -8,6 +8,7 @@ export default class EpicCreate extends PMOCommand {
8
8
  description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
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
  execute(): Promise<void>;
@@ -4,6 +4,7 @@ export default class Epic 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 EpicLinkBlock extends PMOCommand {
9
9
  static flags: {
10
10
  project: 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
  };
13
14
  execute(): Promise<void>;
14
15
  }
@@ -9,6 +9,7 @@ export default class EpicLinkDuplicates extends PMOCommand {
9
9
  static flags: {
10
10
  project: 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
  };
13
14
  execute(): Promise<void>;
14
15
  }
@@ -12,6 +12,7 @@ export default class EpicLink extends PMOCommand {
12
12
  duplicates: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
13
  all: 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
  };
16
17
  execute(): Promise<void>;
17
18
  private addDependency;
@@ -9,6 +9,7 @@ export default class EpicLinkRelates extends PMOCommand {
9
9
  static flags: {
10
10
  project: 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
  };
13
14
  execute(): Promise<void>;
14
15
  }
@@ -11,6 +11,7 @@ export default class EpicLinkRemove extends PMOCommand {
11
11
  type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
13
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
15
  };
15
16
  execute(): Promise<void>;
16
17
  }
@@ -4,6 +4,8 @@ export default class EpicList extends PMOCommand {
4
4
  static examples: string[];
5
5
  static flags: {
6
6
  status: import("@oclif/core/interfaces").OptionFlag<string | undefined, 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
  execute(): Promise<void>;
@@ -9,6 +9,7 @@ export default class EpicMove extends PMOCommand {
9
9
  static flags: {
10
10
  json: 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>;
@@ -8,6 +8,7 @@ export default class EpicProgress extends PMOCommand {
8
8
  static flags: {
9
9
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  all: 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
  execute(): Promise<void>;
@@ -9,6 +9,7 @@ export default class EpicProject extends PMOCommand {
9
9
  static flags: {
10
10
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  'with-tickets': 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>;
@@ -15,6 +15,7 @@ export default class EpicReorder extends PMOCommand {
15
15
  after: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
16
  before: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
17
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
19
  project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
20
  };
20
21
  execute(): Promise<void>;
@@ -9,6 +9,7 @@ export default class EpicSpec extends PMOCommand {
9
9
  static flags: {
10
10
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  unlink: 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>;
@@ -12,6 +12,7 @@ export default class EpicTicket extends PMOCommand {
12
12
  unlink: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
13
  spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
14
  'unlink-spec': 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
  execute(): Promise<void>;
@@ -7,6 +7,7 @@ export default class EpicView 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
  execute(): Promise<void>;
@@ -4,6 +4,7 @@ export default class Execution 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
2
  import inquirer from 'inquirer';
3
3
  import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
4
- import { shouldOutputJson, outputPromptAsJson, createMetadata, buildPromptConfig, } from '../../lib/prompt-json.js';
5
4
  export default class Execution extends PMOCommand {
6
5
  static description = 'Single execution operations (logs, stop)';
7
6
  static examples = [
@@ -21,37 +20,22 @@ export default class Execution extends PMOCommand {
21
20
  }
22
21
  async execute() {
23
22
  const { flags } = await this.parse(Execution);
24
- // Check if JSON output mode is active
25
- const jsonMode = shouldOutputJson(flags);
26
- // Define choices once, use for both JSON and interactive modes
27
- const menuChoices = [
28
- { name: 'List all executions', value: 'list' },
29
- { name: 'View logs for an execution', value: 'logs' },
30
- { name: 'Stop an execution', value: 'stop' },
31
- { name: 'Stop all running', value: 'stop-all' },
32
- { name: 'Cancel', value: 'cancel' },
33
- ];
34
- const message = 'What would you like to do?';
35
- // In JSON mode, output menu prompt
36
- if (jsonMode) {
37
- outputPromptAsJson(buildPromptConfig('list', 'action', message, menuChoices), createMetadata('execution', flags));
38
- return;
39
- }
40
- const { action } = await inquirer.prompt([
23
+ const jsonModeConfig = (flags.json || flags.machine) ? { flags, commandName: 'execution' } : null;
24
+ const { action } = await this.prompt([
41
25
  {
42
26
  type: 'list',
43
27
  name: 'action',
44
- message,
28
+ message: 'What would you like to do?',
45
29
  choices: [
46
- { name: '📋 ' + menuChoices[0].name, value: menuChoices[0].value },
47
- { name: '📜 ' + menuChoices[1].name, value: menuChoices[1].value },
48
- { name: '🛑 ' + menuChoices[2].name, value: menuChoices[2].value },
49
- { name: '🛑 ' + menuChoices[3].name, value: menuChoices[3].value },
30
+ { name: '📋 List all executions', value: 'list', command: 'prlt execution list --json' },
31
+ { name: '📜 View logs for an execution', value: 'logs', command: 'prlt execution logs --json' },
32
+ { name: '🛑 Stop an execution', value: 'stop', command: 'prlt execution stop --json' },
33
+ { name: '🛑 Stop all running', value: 'stop-all', command: 'prlt execution stop --all --json' },
50
34
  new inquirer.Separator(),
51
- { name: '❌ ' + menuChoices[4].name, value: menuChoices[4].value },
35
+ { name: '❌ Cancel', value: 'cancel', command: '' },
52
36
  ],
53
37
  },
54
- ]);
38
+ ], jsonModeConfig);
55
39
  if (action === 'cancel') {
56
40
  return;
57
41
  }
@@ -6,6 +6,8 @@ export default class ExecutionList extends PMOCommand {
6
6
  status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  limit: import("@oclif/core/interfaces").OptionFlag<number, 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(): {
@@ -9,6 +9,7 @@ export default class ExecutionLogs extends PMOCommand {
9
9
  follow: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  tail: 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(): {