@proletariat/cli 0.3.18 → 0.3.20

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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/bin/dev.js +0 -0
  3. package/dist/commands/agent/staff/remove.d.ts +1 -0
  4. package/dist/commands/agent/staff/remove.js +34 -26
  5. package/dist/commands/agent/temp/cleanup.js +10 -17
  6. package/dist/commands/board/view.d.ts +15 -0
  7. package/dist/commands/board/view.js +136 -0
  8. package/dist/commands/config/index.js +6 -3
  9. package/dist/commands/execution/config.d.ts +34 -0
  10. package/dist/commands/execution/config.js +411 -0
  11. package/dist/commands/execution/index.js +6 -1
  12. package/dist/commands/execution/kill.d.ts +9 -0
  13. package/dist/commands/execution/kill.js +16 -0
  14. package/dist/commands/execution/view.d.ts +17 -0
  15. package/dist/commands/execution/view.js +288 -0
  16. package/dist/commands/phase/template/create.js +67 -20
  17. package/dist/commands/pr/index.js +6 -2
  18. package/dist/commands/pr/list.d.ts +17 -0
  19. package/dist/commands/pr/list.js +163 -0
  20. package/dist/commands/project/update.d.ts +19 -0
  21. package/dist/commands/project/update.js +163 -0
  22. package/dist/commands/roadmap/create.js +5 -0
  23. package/dist/commands/spec/delete.d.ts +18 -0
  24. package/dist/commands/spec/delete.js +111 -0
  25. package/dist/commands/spec/edit.d.ts +23 -0
  26. package/dist/commands/spec/edit.js +232 -0
  27. package/dist/commands/spec/index.js +5 -0
  28. package/dist/commands/status/create.js +38 -34
  29. package/dist/commands/template/phase/create.d.ts +1 -0
  30. package/dist/commands/template/phase/create.js +10 -1
  31. package/dist/commands/template/ticket/create.d.ts +20 -0
  32. package/dist/commands/template/ticket/create.js +87 -0
  33. package/dist/commands/template/ticket/save.d.ts +2 -0
  34. package/dist/commands/template/ticket/save.js +11 -0
  35. package/dist/commands/ticket/create.js +7 -0
  36. package/dist/commands/ticket/template/create.d.ts +9 -1
  37. package/dist/commands/ticket/template/create.js +224 -52
  38. package/dist/commands/ticket/template/save.d.ts +2 -1
  39. package/dist/commands/ticket/template/save.js +58 -7
  40. package/dist/commands/work/ready.js +8 -8
  41. package/dist/lib/agents/index.js +14 -4
  42. package/dist/lib/branch/index.js +24 -0
  43. package/dist/lib/execution/config.d.ts +2 -0
  44. package/dist/lib/execution/config.js +12 -0
  45. package/dist/lib/pmo/utils.d.ts +4 -2
  46. package/dist/lib/pmo/utils.js +4 -2
  47. package/oclif.manifest.json +2555 -1781
  48. package/package.json +5 -6
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chris McDermut
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/bin/dev.js CHANGED
File without changes
@@ -7,6 +7,7 @@ export default class Remove extends PMOCommand {
7
7
  };
8
8
  static flags: {
9
9
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
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
  };
@@ -22,6 +22,11 @@ export default class Remove extends PMOCommand {
22
22
  description: 'Output prompt configuration as JSON (for AI agents/scripts)',
23
23
  default: false,
24
24
  }),
25
+ force: Flags.boolean({
26
+ char: 'f',
27
+ description: 'Skip confirmation prompt (for non-interactive use)',
28
+ default: false,
29
+ }),
25
30
  };
26
31
  getPMOOptions() {
27
32
  return { promptIfMultiple: false };
@@ -88,33 +93,36 @@ export default class Remove extends PMOCommand {
88
93
  return handleError('AGENT_NOT_FOUND', `Staff agent "${agentName}" not found. Available staff agents: ${staffAgents.map((a) => a.name).join(', ')}`);
89
94
  }
90
95
  const agentsToRemove = [agentName];
91
- // Build choices once, use for both JSON and interactive modes
92
- const confirmChoices = [
93
- { name: 'No, cancel', value: 'false' },
94
- { name: 'Yes, remove agent', value: 'true' },
95
- ];
96
- const confirmMessage = `Are you sure you want to remove agent "${agentName}"? This will delete its worktree.`;
97
- // Confirm removal
98
- // In JSON mode, output confirmation prompt
99
- if (jsonMode) {
100
- outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('agent remove', flags));
101
- return;
102
- }
103
- const { confirm } = await inquirer.prompt([
104
- {
105
- type: 'list',
106
- name: 'confirm',
107
- message: confirmMessage,
108
- choices: [
109
- { name: '❌ ' + confirmChoices[0].name, value: false },
110
- { name: '⚠️ ' + confirmChoices[1].name, value: true }
111
- ],
112
- default: 0 // Default to "No, cancel"
96
+ // Skip confirmation if --force flag is passed
97
+ if (!flags.force) {
98
+ // Build choices once, use for both JSON and interactive modes
99
+ const confirmChoices = [
100
+ { name: 'No, cancel', value: 'false' },
101
+ { name: 'Yes, remove agent', value: 'true' },
102
+ ];
103
+ const confirmMessage = `Are you sure you want to remove agent "${agentName}"? This will delete its worktree.`;
104
+ // Confirm removal
105
+ // In JSON mode, output confirmation prompt
106
+ if (jsonMode) {
107
+ outputPromptAsJson(buildPromptConfig('list', 'confirmed', confirmMessage, confirmChoices), createMetadata('agent remove', flags));
108
+ return;
109
+ }
110
+ const { confirm } = await inquirer.prompt([
111
+ {
112
+ type: 'list',
113
+ name: 'confirm',
114
+ message: confirmMessage,
115
+ choices: [
116
+ { name: '❌ ' + confirmChoices[0].name, value: false },
117
+ { name: '⚠️ ' + confirmChoices[1].name, value: true }
118
+ ],
119
+ default: 0 // Default to "No, cancel"
120
+ }
121
+ ]);
122
+ if (!confirm) {
123
+ this.log(colors.textMuted('Removal cancelled.'));
124
+ return;
113
125
  }
114
- ]);
115
- if (!confirm) {
116
- this.log(colors.textMuted('Removal cancelled.'));
117
- return;
118
126
  }
119
127
  // Remove agents
120
128
  this.log(colors.primary(`Removing agent "${agentName}"...`));
@@ -132,9 +132,16 @@ export default class Cleanup extends PMOCommand {
132
132
  this.log(colors.textMuted('No agents to clean up.'));
133
133
  return;
134
134
  }
135
- // Separate temp and staff agents
135
+ // Get temp (ephemeral) agents only - this is temp cleanup, not staff cleanup
136
136
  const tempAgents = allAgents.filter(a => a.type === 'ephemeral');
137
- const staffAgents = allAgents.filter(a => a.type !== 'ephemeral');
137
+ if (tempAgents.length === 0) {
138
+ if (jsonMode) {
139
+ outputErrorAsJson('NO_TEMP_AGENTS', 'No temp agents to clean up.', createMetadata('agent cleanup', flags));
140
+ return;
141
+ }
142
+ this.log(colors.textMuted('No temp agents to clean up.'));
143
+ return;
144
+ }
138
145
  // Build choices with separators
139
146
  const choices = [];
140
147
  // Add "All temp agents" option if there are temp agents
@@ -163,21 +170,7 @@ export default class Cleanup extends PMOCommand {
163
170
  });
164
171
  }
165
172
  }
166
- // Add staff agents
167
- if (staffAgents.length > 0) {
168
- choices.push(new inquirer.Separator(`── Staff Agents (${staffAgents.length}) ──`));
169
- for (const agent of staffAgents) {
170
- const sessions = getAgentTmuxSessions(agent.name);
171
- const hasRunningWork = sessions.length > 0;
172
- const statusLabel = hasRunningWork ? ' (running)' : '';
173
- choices.push({
174
- name: `${agent.name}${statusLabel}`,
175
- value: agent.name,
176
- disabled: hasRunningWork ? 'has running work' : false,
177
- });
178
- }
179
- }
180
- const selectMessage = 'Select agents to clean up:';
173
+ const selectMessage = 'Select temp agents to clean up:';
181
174
  // In JSON mode, output agent selection prompt
182
175
  if (jsonMode) {
183
176
  outputPromptAsJson(buildPromptConfig('checkbox', 'agents', selectMessage, choices), createMetadata('agent cleanup', flags));
@@ -0,0 +1,15 @@
1
+ import { PMOCommand } from '../../lib/pmo/index.js';
2
+ export default class BoardView extends PMOCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ compact: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ execute(): Promise<void>;
12
+ private renderBoard;
13
+ private outputTicketCompact;
14
+ private outputTicketFull;
15
+ }
@@ -0,0 +1,136 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { PMOCommand, pmoBaseFlags, } from '../../lib/pmo/index.js';
3
+ import { styles, formatPriority, formatCategory, getColumnStyle, getColumnEmoji, divider, } from '../../lib/styles.js';
4
+ import { shouldOutputJson, outputErrorAsJson, outputSuccessAsJson, createMetadata, } from '../../lib/prompt-json.js';
5
+ export default class BoardView extends PMOCommand {
6
+ static description = 'View the kanban board';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %>',
9
+ '<%= config.bin %> <%= command.id %> --compact',
10
+ '<%= config.bin %> <%= command.id %> --json',
11
+ ];
12
+ static flags = {
13
+ ...pmoBaseFlags,
14
+ compact: Flags.boolean({
15
+ char: 'c',
16
+ description: 'Show compact ticket view (ID and title only)',
17
+ default: false,
18
+ }),
19
+ };
20
+ async execute() {
21
+ const { flags } = await this.parse(BoardView);
22
+ // Board operations require project context
23
+ const projectId = await this.requireProject();
24
+ // Check if JSON output mode is active
25
+ const jsonMode = shouldOutputJson(flags);
26
+ // Helper to handle errors in JSON mode
27
+ const handleError = (code, message) => {
28
+ if (jsonMode) {
29
+ outputErrorAsJson(code, message, createMetadata('board view', flags));
30
+ this.exit(1);
31
+ }
32
+ this.error(message);
33
+ };
34
+ const board = await this.storage.getBoard(projectId);
35
+ if (!board) {
36
+ return handleError('BOARD_NOT_FOUND', `Board not found for project "${projectId}".`);
37
+ }
38
+ // In JSON mode, output board as structured data
39
+ if (jsonMode) {
40
+ outputSuccessAsJson({
41
+ id: board.id,
42
+ name: board.name,
43
+ columns: board.columns.map(col => ({
44
+ id: col.id,
45
+ name: col.name,
46
+ position: col.position,
47
+ ticketCount: col.tickets.length,
48
+ tickets: col.tickets.map(t => ({
49
+ id: t.id,
50
+ title: t.title,
51
+ description: t.description,
52
+ priority: t.priority,
53
+ category: t.category,
54
+ owner: t.owner,
55
+ assignee: t.assignee,
56
+ specId: t.specId,
57
+ epicId: t.epicId,
58
+ labels: t.labels,
59
+ subtasksDone: t.subtasks.filter((s) => s.done).length,
60
+ subtasksTotal: t.subtasks.length,
61
+ position: t.position,
62
+ })),
63
+ })),
64
+ totalTickets: board.columns.reduce((sum, col) => sum + col.tickets.length, 0),
65
+ }, createMetadata('board view', flags));
66
+ return;
67
+ }
68
+ // Interactive mode - render board to terminal
69
+ this.renderBoard(board, flags.compact);
70
+ }
71
+ renderBoard(board, compact) {
72
+ // Header
73
+ this.log(styles.title(`\n${board.name}`));
74
+ this.log(styles.muted(`Storage: SQLite`));
75
+ this.log(styles.muted('═'.repeat(60)));
76
+ // Display ALL columns (always show empty ones too)
77
+ for (const column of board.columns) {
78
+ const headerColor = getColumnStyle(column.name);
79
+ const emoji = getColumnEmoji(column.name);
80
+ this.log(headerColor(`\n${emoji} ${column.name} (${column.tickets.length})`));
81
+ this.log(divider(50));
82
+ if (column.tickets.length === 0) {
83
+ this.log(styles.muted(' (empty)'));
84
+ continue;
85
+ }
86
+ // Sort tickets by position
87
+ const sortedTickets = [...column.tickets].sort((a, b) => (a.position || 0) - (b.position || 0));
88
+ for (const ticket of sortedTickets) {
89
+ if (compact) {
90
+ this.outputTicketCompact(ticket);
91
+ }
92
+ else {
93
+ this.outputTicketFull(ticket);
94
+ }
95
+ }
96
+ }
97
+ // Summary
98
+ const totalTickets = board.columns.reduce((sum, col) => sum + col.tickets.length, 0);
99
+ this.log(styles.muted('\n' + '═'.repeat(60)));
100
+ this.log(styles.emphasis(`Total: ${totalTickets} ticket${totalTickets === 1 ? '' : 's'}`));
101
+ // Per-column summary (only non-empty)
102
+ const summary = board.columns
103
+ .filter(col => col.tickets.length > 0)
104
+ .map(col => `${col.name}: ${col.tickets.length}`)
105
+ .join(' | ');
106
+ if (summary) {
107
+ this.log(styles.primary(summary));
108
+ }
109
+ this.log(styles.muted('\nCommands:'));
110
+ this.log(styles.primary(' prlt ticket create ') + styles.muted('Create a new ticket'));
111
+ this.log(styles.primary(' prlt ticket list ') + styles.muted('List all tickets'));
112
+ this.log(styles.primary(' prlt ticket move <id> ') + styles.muted('Move a ticket'));
113
+ }
114
+ outputTicketCompact(ticket) {
115
+ const priority = formatPriority(ticket.priority);
116
+ this.log(` ${styles.code(ticket.id)}: ${ticket.title} ${priority}`);
117
+ }
118
+ outputTicketFull(ticket) {
119
+ const priority = formatPriority(ticket.priority);
120
+ const category = formatCategory(ticket.category);
121
+ this.log(` ${styles.code(ticket.id)} ${ticket.title} ${priority} ${category}`);
122
+ if (ticket.description) {
123
+ const shortDesc = ticket.description.split('\n')[0].substring(0, 55);
124
+ this.log(styles.muted(` ${shortDesc}${ticket.description.length > 55 ? '...' : ''}`));
125
+ }
126
+ if (ticket.subtasks.length > 0) {
127
+ const done = ticket.subtasks.filter(s => s.done).length;
128
+ const total = ticket.subtasks.length;
129
+ const progress = Math.round((done / total) * 100);
130
+ this.log(styles.muted(` Subtasks: ${done}/${total} (${progress}%)`));
131
+ }
132
+ if (ticket.specId) {
133
+ this.log(styles.muted(` Spec: ${ticket.specId}`));
134
+ }
135
+ }
136
+ }
@@ -6,7 +6,7 @@ import { Command } from '@oclif/core';
6
6
  import { styles } from '../../lib/styles.js';
7
7
  import { getWorkspaceInfo } from '../../lib/agents/commands.js';
8
8
  import { loadExecutionConfig, saveTerminalApp, saveTerminalOpenInBackground, saveTmuxControlMode, saveShell, } from '../../lib/execution/config.js';
9
- import { shouldOutputJson, isAgentMode, outputPromptAsJson, outputSuccessAsJson, outputErrorAsJson, createMetadata, normalizeChoices, } from '../../lib/prompt-json.js';
9
+ import { shouldOutputJson, isAgentMode, isNonTTY, outputPromptAsJson, outputSuccessAsJson, outputErrorAsJson, createMetadata, normalizeChoices, } from '../../lib/prompt-json.js';
10
10
  export default class Config extends Command {
11
11
  static description = 'View and update workspace configuration';
12
12
  static examples = [
@@ -103,8 +103,11 @@ export default class Config extends Command {
103
103
  return;
104
104
  }
105
105
  // Handle --list or --json flag without --setting (just show config)
106
- if ((flags.list || flags.json) && !flags.setting) {
107
- if (jsonMode) {
106
+ // Also handle non-TTY mode without explicit flags - output config as readable list
107
+ const isExplicitJsonMode = flags.json === true;
108
+ const shouldShowConfigList = flags.list || (isExplicitJsonMode && !flags.setting) || (isNonTTY() && !flags.setting && !flags.set?.length);
109
+ if (shouldShowConfigList) {
110
+ if (isExplicitJsonMode) {
108
111
  outputSuccessAsJson({
109
112
  terminal: {
110
113
  app: config.terminal.app,
@@ -0,0 +1,34 @@
1
+ import { PMOCommand } from '../../lib/pmo/index.js';
2
+ export default class ExecutionConfig extends PMOCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ set: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ list: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ setting: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ protected getPMOOptions(): {
14
+ promptIfMultiple: boolean;
15
+ };
16
+ /**
17
+ * Prompt wrapper - drop-in replacement for inquirer.prompt
18
+ */
19
+ private promptUser;
20
+ execute(): Promise<void>;
21
+ /**
22
+ * Handle a specific setting's sub-prompt
23
+ */
24
+ private handleSettingPrompt;
25
+ private setConfigValue;
26
+ /**
27
+ * Save output mode to workspace settings
28
+ */
29
+ private setOutputMode;
30
+ /**
31
+ * Save sandboxed preference to workspace settings
32
+ */
33
+ private setSandboxed;
34
+ }