@proletariat/cli 0.3.17 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/action/create.d.ts +1 -0
- package/dist/commands/action/create.js +74 -38
- package/dist/commands/action/delete.d.ts +1 -0
- package/dist/commands/action/delete.js +23 -24
- package/dist/commands/action/index.d.ts +1 -0
- package/dist/commands/action/index.js +5 -10
- package/dist/commands/action/list.d.ts +1 -0
- package/dist/commands/action/list.js +3 -1
- package/dist/commands/action/run.d.ts +1 -0
- package/dist/commands/action/run.js +44 -32
- package/dist/commands/action/show.d.ts +2 -0
- package/dist/commands/action/update.d.ts +1 -0
- package/dist/commands/action/update.js +80 -39
- package/dist/commands/agent/auth.d.ts +2 -0
- package/dist/commands/agent/auth.js +44 -3
- package/dist/commands/agent/discover.d.ts +2 -0
- package/dist/commands/agent/discover.js +35 -3
- package/dist/commands/agent/index.d.ts +1 -0
- package/dist/commands/agent/index.js +25 -45
- package/dist/commands/agent/list.d.ts +8 -3
- package/dist/commands/agent/list.js +16 -29
- package/dist/commands/agent/login.d.ts +1 -0
- package/dist/commands/agent/login.js +14 -32
- package/dist/commands/agent/rebuild.d.ts +1 -0
- package/dist/commands/agent/rebuild.js +2 -2
- package/dist/commands/agent/remove.d.ts +17 -0
- package/dist/commands/agent/remove.js +144 -0
- package/dist/commands/agent/restart.d.ts +1 -0
- package/dist/commands/agent/restart.js +2 -2
- package/dist/commands/agent/shell.d.ts +1 -0
- package/dist/commands/agent/shell.js +63 -76
- package/dist/commands/agent/staff/add.d.ts +1 -0
- package/dist/commands/agent/staff/add.js +7 -1
- package/dist/commands/agent/staff/index.d.ts +1 -0
- package/dist/commands/agent/staff/index.js +5 -4
- package/dist/commands/agent/staff/remove.d.ts +1 -0
- package/dist/commands/agent/status.d.ts +1 -0
- package/dist/commands/agent/status.js +11 -23
- package/dist/commands/agent/temp/cleanup.d.ts +1 -0
- package/dist/commands/agent/temp/index.d.ts +1 -0
- package/dist/commands/agent/temp/index.js +4 -3
- package/dist/commands/agent/themes/index.d.ts +1 -0
- package/dist/commands/agent/themes/index.js +9 -3
- package/dist/commands/agent/themes/set.d.ts +1 -0
- package/dist/commands/agent/themes/set.js +7 -1
- package/dist/commands/agent/visit.d.ts +1 -0
- package/dist/commands/agent/visit.js +11 -23
- package/dist/commands/autocomplete/setup.d.ts +11 -0
- package/dist/commands/autocomplete/setup.js +113 -8
- package/dist/commands/board/index.d.ts +4 -0
- package/dist/commands/board/index.js +32 -30
- package/dist/commands/board/watch.d.ts +2 -0
- package/dist/commands/branch/create.d.ts +1 -0
- package/dist/commands/branch/create.js +33 -41
- package/dist/commands/branch/index.d.ts +1 -0
- package/dist/commands/branch/list.d.ts +2 -0
- package/dist/commands/branch/validate.d.ts +2 -0
- package/dist/commands/branch/where.d.ts +1 -0
- package/dist/commands/claude.d.ts +6 -0
- package/dist/commands/claude.js +166 -116
- package/dist/commands/commit.d.ts +6 -0
- package/dist/commands/commit.js +68 -73
- package/dist/commands/config/index.d.ts +13 -0
- package/dist/commands/config/index.js +142 -98
- package/dist/commands/docker/clean.d.ts +2 -1
- package/dist/commands/docker/clean.js +20 -29
- package/dist/commands/docker/index.d.ts +1 -0
- package/dist/commands/docker/index.js +37 -41
- package/dist/commands/docker/prune.d.ts +2 -1
- package/dist/commands/docker/prune.js +20 -27
- package/dist/commands/docker/restart.d.ts +2 -1
- package/dist/commands/docker/restart.js +20 -29
- package/dist/commands/docker/stop.d.ts +2 -1
- package/dist/commands/docker/stop.js +20 -29
- package/dist/commands/epic/activate.d.ts +1 -0
- package/dist/commands/epic/archive.d.ts +1 -0
- package/dist/commands/epic/create.d.ts +1 -0
- package/dist/commands/epic/index.d.ts +1 -0
- package/dist/commands/epic/link/block.d.ts +1 -0
- package/dist/commands/epic/link/duplicates.d.ts +1 -0
- package/dist/commands/epic/link/index.d.ts +1 -0
- package/dist/commands/epic/link/relates.d.ts +1 -0
- package/dist/commands/epic/link/remove.d.ts +1 -0
- package/dist/commands/epic/list.d.ts +2 -0
- package/dist/commands/epic/move.d.ts +1 -0
- package/dist/commands/epic/progress.d.ts +1 -0
- package/dist/commands/epic/project.d.ts +1 -0
- package/dist/commands/epic/reorder.d.ts +1 -0
- package/dist/commands/epic/spec.d.ts +1 -0
- package/dist/commands/epic/ticket.d.ts +1 -0
- package/dist/commands/epic/view.d.ts +1 -0
- package/dist/commands/execution/index.d.ts +1 -0
- package/dist/commands/execution/index.js +9 -25
- package/dist/commands/execution/list.d.ts +2 -0
- package/dist/commands/execution/logs.d.ts +1 -0
- package/dist/commands/execution/logs.js +6 -16
- package/dist/commands/execution/stop.d.ts +1 -0
- package/dist/commands/execution/stop.js +4 -15
- package/dist/commands/gh/index.d.ts +1 -0
- package/dist/commands/gh/index.js +27 -27
- package/dist/commands/gh/login.d.ts +4 -0
- package/dist/commands/gh/login.js +31 -0
- package/dist/commands/gh/status.d.ts +4 -0
- package/dist/commands/gh/status.js +27 -4
- package/dist/commands/gh/token.d.ts +4 -0
- package/dist/commands/gh/token.js +49 -5
- package/dist/commands/phase/create.d.ts +1 -1
- package/dist/commands/phase/create.js +116 -74
- package/dist/commands/phase/delete.d.ts +1 -0
- package/dist/commands/phase/delete.js +23 -22
- package/dist/commands/phase/list.d.ts +1 -0
- package/dist/commands/phase/list.js +3 -5
- package/dist/commands/phase/move.d.ts +1 -0
- package/dist/commands/phase/move.js +39 -39
- package/dist/commands/phase/template/apply.d.ts +1 -0
- package/dist/commands/phase/template/create.d.ts +2 -0
- package/dist/commands/phase/template/delete.d.ts +1 -0
- package/dist/commands/phase/template/index.d.ts +1 -0
- package/dist/commands/phase/template/list.d.ts +1 -0
- package/dist/commands/phase/template/update.d.ts +2 -0
- package/dist/commands/phase/update.d.ts +1 -1
- package/dist/commands/phase/update.js +89 -55
- package/dist/commands/pmo/init.d.ts +2 -0
- package/dist/commands/pmo/init.js +84 -22
- package/dist/commands/pr/create.d.ts +12 -3
- package/dist/commands/pr/create.js +130 -147
- package/dist/commands/pr/index.d.ts +6 -3
- package/dist/commands/pr/index.js +41 -39
- package/dist/commands/pr/link.d.ts +7 -3
- package/dist/commands/pr/link.js +126 -150
- package/dist/commands/pr/status.d.ts +6 -3
- package/dist/commands/pr/status.js +101 -126
- package/dist/commands/project/archive.d.ts +1 -0
- package/dist/commands/project/archive.js +15 -20
- package/dist/commands/project/create.d.ts +1 -0
- package/dist/commands/project/create.js +13 -5
- package/dist/commands/project/delete.d.ts +1 -0
- package/dist/commands/project/delete.js +14 -28
- package/dist/commands/project/index.d.ts +1 -0
- package/dist/commands/project/index.js +0 -5
- package/dist/commands/project/list.d.ts +2 -0
- package/dist/commands/project/list.js +21 -3
- package/dist/commands/project/spec.d.ts +1 -0
- package/dist/commands/project/spec.js +17 -23
- package/dist/commands/project/unarchive.d.ts +2 -0
- package/dist/commands/project/unarchive.js +21 -2
- package/dist/commands/project/view.d.ts +1 -0
- package/dist/commands/project/view.js +34 -22
- package/dist/commands/repo/add.d.ts +2 -0
- package/dist/commands/repo/add.js +44 -1
- package/dist/commands/repo/index.d.ts +1 -0
- package/dist/commands/repo/index.js +20 -38
- package/dist/commands/repo/list.d.ts +2 -0
- package/dist/commands/repo/remove.d.ts +1 -0
- package/dist/commands/repo/remove.js +45 -63
- package/dist/commands/repo/view.d.ts +2 -0
- package/dist/commands/repo/view.js +30 -5
- package/dist/commands/roadmap/add-project.d.ts +1 -0
- package/dist/commands/roadmap/create.d.ts +1 -0
- package/dist/commands/roadmap/delete.d.ts +1 -0
- package/dist/commands/roadmap/generate.d.ts +1 -0
- package/dist/commands/roadmap/index.d.ts +1 -0
- package/dist/commands/roadmap/list.d.ts +2 -0
- package/dist/commands/roadmap/remove-project.d.ts +1 -0
- package/dist/commands/roadmap/reorder.d.ts +1 -0
- package/dist/commands/roadmap/update.d.ts +1 -0
- package/dist/commands/roadmap/view.d.ts +1 -0
- package/dist/commands/session/attach.d.ts +1 -0
- package/dist/commands/session/index.d.ts +1 -0
- package/dist/commands/session/index.js +8 -25
- package/dist/commands/session/list.d.ts +2 -0
- package/dist/commands/spec/create.d.ts +1 -1
- package/dist/commands/spec/create.js +64 -65
- package/dist/commands/spec/index.d.ts +1 -0
- package/dist/commands/spec/index.js +36 -22
- package/dist/commands/spec/link/depends.d.ts +1 -0
- package/dist/commands/spec/link/depends.js +6 -6
- package/dist/commands/spec/link/duplicates.d.ts +1 -0
- package/dist/commands/spec/link/duplicates.js +6 -6
- package/dist/commands/spec/link/index.d.ts +2 -1
- package/dist/commands/spec/link/index.js +0 -4
- package/dist/commands/spec/link/relates.d.ts +1 -0
- package/dist/commands/spec/link/relates.js +6 -6
- package/dist/commands/spec/link/remove.d.ts +2 -1
- package/dist/commands/spec/link/remove.js +6 -6
- package/dist/commands/spec/list.d.ts +2 -0
- package/dist/commands/spec/list.js +25 -0
- package/dist/commands/spec/plan.d.ts +2 -1
- package/dist/commands/spec/plan.js +19 -26
- package/dist/commands/spec/ticket.d.ts +2 -1
- package/dist/commands/spec/ticket.js +48 -34
- package/dist/commands/spec/view.d.ts +2 -1
- package/dist/commands/spec/view.js +25 -16
- package/dist/commands/status/create.d.ts +1 -1
- package/dist/commands/status/create.js +80 -64
- package/dist/commands/status/delete.d.ts +2 -1
- package/dist/commands/status/delete.js +26 -22
- package/dist/commands/status/index.d.ts +1 -0
- package/dist/commands/status/index.js +26 -19
- package/dist/commands/status/list.d.ts +1 -0
- package/dist/commands/status/list.js +12 -7
- package/dist/commands/status/move.d.ts +2 -1
- package/dist/commands/status/move.js +62 -61
- package/dist/commands/status/update.d.ts +2 -2
- package/dist/commands/status/update.js +110 -77
- package/dist/commands/template/delete.d.ts +1 -0
- package/dist/commands/template/delete.js +47 -48
- package/dist/commands/template/index.d.ts +1 -0
- package/dist/commands/template/index.js +26 -33
- package/dist/commands/template/list.d.ts +1 -0
- package/dist/commands/template/phase/create.d.ts +1 -0
- package/dist/commands/template/phase/create.js +6 -0
- package/dist/commands/template/phase/index.d.ts +1 -0
- package/dist/commands/template/phase/index.js +27 -26
- package/dist/commands/template/phase/update.d.ts +1 -0
- package/dist/commands/template/phase/update.js +6 -0
- package/dist/commands/template/ticket/index.d.ts +1 -0
- package/dist/commands/template/ticket/index.js +27 -26
- package/dist/commands/template/ticket/save.d.ts +1 -0
- package/dist/commands/template/ticket/save.js +6 -0
- package/dist/commands/terminal/title.d.ts +26 -0
- package/dist/commands/terminal/title.js +37 -3
- package/dist/commands/ticket/bulk.d.ts +1 -0
- package/dist/commands/ticket/complete.d.ts +1 -0
- package/dist/commands/ticket/complete.js +18 -14
- package/dist/commands/ticket/create.d.ts +1 -0
- package/dist/commands/ticket/create.js +45 -41
- package/dist/commands/ticket/delete.d.ts +1 -0
- package/dist/commands/ticket/delete.js +1 -1
- package/dist/commands/ticket/edit.d.ts +1 -0
- package/dist/commands/ticket/edit.js +1 -1
- package/dist/commands/ticket/epic.d.ts +1 -0
- package/dist/commands/ticket/epic.js +2 -2
- package/dist/commands/ticket/index.d.ts +1 -0
- package/dist/commands/ticket/link/block.d.ts +1 -0
- package/dist/commands/ticket/link/block.js +1 -1
- package/dist/commands/ticket/link/duplicates.d.ts +1 -0
- package/dist/commands/ticket/link/duplicates.js +1 -1
- package/dist/commands/ticket/link/index.d.ts +1 -0
- package/dist/commands/ticket/link/index.js +9 -8
- package/dist/commands/ticket/link/relates.d.ts +1 -0
- package/dist/commands/ticket/link/relates.js +1 -1
- package/dist/commands/ticket/link/remove.d.ts +1 -0
- package/dist/commands/ticket/link/remove.js +1 -1
- package/dist/commands/ticket/list.d.ts +2 -0
- package/dist/commands/ticket/move.d.ts +1 -0
- package/dist/commands/ticket/move.js +27 -19
- package/dist/commands/ticket/project.d.ts +1 -0
- package/dist/commands/ticket/project.js +3 -3
- package/dist/commands/ticket/reassign.d.ts +1 -0
- package/dist/commands/ticket/reassign.js +1 -1
- package/dist/commands/ticket/spec.d.ts +1 -0
- package/dist/commands/ticket/spec.js +3 -3
- package/dist/commands/ticket/status.d.ts +1 -0
- package/dist/commands/ticket/status.js +1 -1
- package/dist/commands/ticket/template/apply.d.ts +1 -0
- package/dist/commands/ticket/template/create.d.ts +2 -0
- package/dist/commands/ticket/template/delete.d.ts +1 -0
- package/dist/commands/ticket/template/index.d.ts +1 -0
- package/dist/commands/ticket/template/list.d.ts +1 -0
- package/dist/commands/ticket/template/save.d.ts +2 -0
- package/dist/commands/ticket/update.d.ts +1 -0
- package/dist/commands/ticket/update.js +1 -1
- package/dist/commands/ticket/view.d.ts +1 -0
- package/dist/commands/ticket/view.js +1 -1
- package/dist/commands/work/complete.d.ts +1 -0
- package/dist/commands/work/index.d.ts +1 -0
- package/dist/commands/work/ready.d.ts +1 -0
- package/dist/commands/work/revise.d.ts +1 -0
- package/dist/commands/work/spawn-all.d.ts +2 -0
- package/dist/commands/work/spawn-all.js +11 -4
- package/dist/commands/work/spawn.d.ts +1 -0
- package/dist/commands/work/spawn.js +261 -166
- package/dist/commands/work/start.d.ts +1 -0
- package/dist/commands/work/start.js +270 -189
- package/dist/commands/work/watch.d.ts +1 -0
- package/dist/commands/work/watch.js +63 -58
- package/dist/commands/workflow/create.d.ts +1 -0
- package/dist/commands/workflow/create.js +2 -4
- package/dist/commands/workflow/delete.d.ts +1 -0
- package/dist/commands/workflow/delete.js +21 -33
- package/dist/commands/workflow/index.d.ts +1 -0
- package/dist/commands/workflow/list.d.ts +1 -0
- package/dist/commands/workflow/list.js +3 -6
- package/dist/commands/workflow/switch.d.ts +2 -0
- package/dist/commands/workflow/switch.js +46 -21
- package/dist/commands/workflow/view.d.ts +1 -0
- package/dist/commands/workflow/view.js +18 -27
- package/dist/commands/workspace/remove.d.ts +2 -2
- package/dist/commands/workspace/remove.js +16 -21
- package/dist/commands/workspace/use.d.ts +2 -2
- package/dist/commands/workspace/use.js +12 -18
- package/dist/lib/agents/commands.d.ts +1 -1
- package/dist/lib/agents/commands.js +4 -4
- package/dist/lib/database/drizzle-schema.d.ts +5009 -0
- package/dist/lib/database/drizzle-schema.js +699 -0
- package/dist/lib/database/drizzle.d.ts +29 -0
- package/dist/lib/database/drizzle.js +37 -0
- package/dist/lib/database/index.d.ts +1 -0
- package/dist/lib/database/index.js +1 -1
- package/dist/lib/execution/config.d.ts +6 -0
- package/dist/lib/execution/config.js +31 -13
- package/dist/lib/execution/devcontainer.js +12 -6
- package/dist/lib/execution/runners.js +13 -7
- package/dist/lib/execution/spawner.js +19 -0
- package/dist/lib/flags/index.d.ts +4 -0
- package/dist/lib/flags/index.js +4 -0
- package/dist/lib/flags/resolver.d.ts +224 -0
- package/dist/lib/flags/resolver.js +313 -0
- package/dist/lib/pmo/base-command.d.ts +53 -3
- package/dist/lib/pmo/base-command.js +92 -13
- package/dist/lib/pmo/find-pmo.d.ts +1 -1
- package/dist/lib/pmo/find-pmo.js +4 -4
- package/dist/lib/pmo/index.d.ts +1 -1
- package/dist/lib/pmo/index.js +1 -1
- package/dist/lib/pmo/storage/helpers.js +2 -1
- package/dist/lib/pmo/storage/index.d.ts +9 -0
- package/dist/lib/pmo/storage/index.js +14 -0
- package/dist/lib/pmo/storage/projects.d.ts +28 -13
- package/dist/lib/pmo/storage/projects.js +110 -34
- package/dist/lib/pmo/storage/roadmaps.d.ts +2 -0
- package/dist/lib/pmo/storage/roadmaps.js +182 -111
- package/dist/lib/pmo/storage/specs.js +13 -16
- package/dist/lib/pmo/storage/subtasks.js +17 -2
- package/dist/lib/pmo/storage/tickets.d.ts +12 -2
- package/dist/lib/pmo/storage/tickets.js +63 -5
- package/dist/lib/pmo/storage/types.d.ts +7 -3
- package/dist/lib/pmo/storage/views.d.ts +12 -1
- package/dist/lib/pmo/storage/views.js +61 -6
- package/dist/lib/prompt-command.d.ts +90 -0
- package/dist/lib/prompt-command.js +102 -0
- package/dist/lib/prompt-json.d.ts +34 -4
- package/dist/lib/prompt-json.js +35 -3
- package/dist/lib/repos/index.js +15 -15
- package/dist/lib/workspace.d.ts +4 -3
- package/dist/lib/workspace.js +3 -3
- package/oclif.manifest.json +3985 -2372
- package/package.json +3 -1
|
@@ -2,6 +2,7 @@ import { Command, Flags } from '@oclif/core';
|
|
|
2
2
|
import { execSync, spawnSync } from 'node:child_process';
|
|
3
3
|
import { colors } from '../../lib/colors.js';
|
|
4
4
|
import { isDockerRunning } from '../../lib/execution/runners.js';
|
|
5
|
+
import { shouldOutputJson, outputSuccessAsJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
6
|
const CLAUDE_CREDENTIALS_VOLUME = 'claude-credentials';
|
|
6
7
|
export default class Auth extends Command {
|
|
7
8
|
static description = 'Set up Claude Code authentication for Docker containers (one-time setup)';
|
|
@@ -19,6 +20,16 @@ export default class Auth extends Command {
|
|
|
19
20
|
description: 'Force re-authentication even if credentials exist',
|
|
20
21
|
default: false,
|
|
21
22
|
}),
|
|
23
|
+
machine: Flags.boolean({
|
|
24
|
+
char: 'm',
|
|
25
|
+
description: 'Output as JSON for AI agents/scripts (machine-readable mode)',
|
|
26
|
+
default: false,
|
|
27
|
+
}),
|
|
28
|
+
json: Flags.boolean({
|
|
29
|
+
description: 'Output as JSON (deprecated, use --machine)',
|
|
30
|
+
default: false,
|
|
31
|
+
hidden: true,
|
|
32
|
+
}),
|
|
22
33
|
};
|
|
23
34
|
/**
|
|
24
35
|
* Check if the claude-credentials volume exists
|
|
@@ -116,21 +127,36 @@ export default class Auth extends Command {
|
|
|
116
127
|
}
|
|
117
128
|
async run() {
|
|
118
129
|
const { flags } = await this.parse(Auth);
|
|
130
|
+
// Check if JSON output mode is active
|
|
131
|
+
const jsonMode = shouldOutputJson(flags);
|
|
119
132
|
// Check Docker is running
|
|
120
133
|
if (!isDockerRunning()) {
|
|
134
|
+
if (jsonMode) {
|
|
135
|
+
outputErrorAsJson('DOCKER_NOT_RUNNING', 'Docker is not running. Please start Docker Desktop and try again.', createMetadata('agent auth', flags));
|
|
136
|
+
}
|
|
121
137
|
this.error('Docker is not running. Please start Docker Desktop and try again.');
|
|
122
138
|
}
|
|
123
139
|
// Ensure volume exists
|
|
124
140
|
if (!this.volumeExists()) {
|
|
125
|
-
|
|
141
|
+
if (!jsonMode) {
|
|
142
|
+
this.log(colors.textSecondary(`Creating Docker volume: ${CLAUDE_CREDENTIALS_VOLUME}`));
|
|
143
|
+
}
|
|
126
144
|
this.createVolume();
|
|
127
145
|
}
|
|
128
146
|
// Check for existing credentials
|
|
129
147
|
const hasCredentials = this.credentialsExist();
|
|
148
|
+
const info = hasCredentials ? this.getCredentialInfo() : null;
|
|
130
149
|
if (flags.check) {
|
|
131
150
|
// Just report status
|
|
132
151
|
if (hasCredentials) {
|
|
133
|
-
|
|
152
|
+
if (jsonMode) {
|
|
153
|
+
outputSuccessAsJson({
|
|
154
|
+
authenticated: true,
|
|
155
|
+
subscriptionType: info?.subscriptionType || 'unknown',
|
|
156
|
+
expiresAt: info?.expiresAt.toISOString(),
|
|
157
|
+
}, createMetadata('agent auth', flags));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
134
160
|
this.log(colors.success('✓ Claude Code credentials are configured'));
|
|
135
161
|
if (info) {
|
|
136
162
|
this.log(colors.textSecondary(` Subscription: ${info.subscriptionType || 'unknown'}`));
|
|
@@ -138,6 +164,9 @@ export default class Auth extends Command {
|
|
|
138
164
|
}
|
|
139
165
|
}
|
|
140
166
|
else {
|
|
167
|
+
if (jsonMode) {
|
|
168
|
+
outputErrorAsJson('NO_CREDENTIALS', 'No Claude Code credentials found. Run "prlt agent auth" to authenticate.', createMetadata('agent auth', flags));
|
|
169
|
+
}
|
|
141
170
|
this.log(colors.warning('✗ No Claude Code credentials found'));
|
|
142
171
|
this.log(colors.textSecondary(' Run "prlt agent auth" to authenticate'));
|
|
143
172
|
this.exit(1);
|
|
@@ -145,7 +174,15 @@ export default class Auth extends Command {
|
|
|
145
174
|
return;
|
|
146
175
|
}
|
|
147
176
|
if (hasCredentials && !flags.force) {
|
|
148
|
-
|
|
177
|
+
if (jsonMode) {
|
|
178
|
+
outputSuccessAsJson({
|
|
179
|
+
authenticated: true,
|
|
180
|
+
subscriptionType: info?.subscriptionType || 'unknown',
|
|
181
|
+
expiresAt: info?.expiresAt.toISOString(),
|
|
182
|
+
message: 'Credentials already configured. Use --force to re-authenticate.',
|
|
183
|
+
}, createMetadata('agent auth', flags));
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
149
186
|
this.log(colors.success('✓ Claude Code credentials already configured'));
|
|
150
187
|
if (info) {
|
|
151
188
|
this.log(colors.textSecondary(` Subscription: ${info.subscriptionType || 'unknown'}`));
|
|
@@ -155,6 +192,10 @@ export default class Auth extends Command {
|
|
|
155
192
|
this.log(colors.text('Use --force to re-authenticate.'));
|
|
156
193
|
return;
|
|
157
194
|
}
|
|
195
|
+
// JSON mode cannot handle interactive login flow
|
|
196
|
+
if (jsonMode) {
|
|
197
|
+
outputErrorAsJson('INTERACTIVE_REQUIRED', 'Authentication requires interactive login. Run without --json flag to authenticate.', createMetadata('agent auth', flags));
|
|
198
|
+
}
|
|
158
199
|
// Run the login flow
|
|
159
200
|
const success = this.runLoginFlow();
|
|
160
201
|
if (success && this.credentialsExist()) {
|
|
@@ -4,6 +4,8 @@ export default class Discover extends Command {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
9
|
};
|
|
8
10
|
run(): Promise<void>;
|
|
9
11
|
}
|
|
@@ -2,6 +2,7 @@ import { Command, Flags } from '@oclif/core';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { getWorkspaceInfo } from '../../lib/agents/commands.js';
|
|
4
4
|
import { discoverAgentsOnDisk } from '../../lib/database/index.js';
|
|
5
|
+
import { shouldOutputJson, outputSuccessAsJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
5
6
|
export default class Discover extends Command {
|
|
6
7
|
static description = 'Discover agents on disk that are not registered in the database';
|
|
7
8
|
static examples = [
|
|
@@ -13,16 +14,44 @@ export default class Discover extends Command {
|
|
|
13
14
|
description: 'Show what would be discovered without making changes',
|
|
14
15
|
default: false,
|
|
15
16
|
}),
|
|
17
|
+
machine: Flags.boolean({
|
|
18
|
+
char: 'm',
|
|
19
|
+
description: 'Output as JSON for AI agents/scripts (machine-readable mode)',
|
|
20
|
+
default: false,
|
|
21
|
+
}),
|
|
22
|
+
json: Flags.boolean({
|
|
23
|
+
description: 'Output as JSON (deprecated, use --machine)',
|
|
24
|
+
default: false,
|
|
25
|
+
hidden: true,
|
|
26
|
+
}),
|
|
16
27
|
};
|
|
17
28
|
async run() {
|
|
18
29
|
const { flags } = await this.parse(Discover);
|
|
30
|
+
// Check if JSON output mode is active
|
|
31
|
+
const jsonMode = shouldOutputJson(flags);
|
|
19
32
|
try {
|
|
20
33
|
const workspaceInfo = getWorkspaceInfo();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
if (!jsonMode) {
|
|
35
|
+
this.log(chalk.bold('\n🔍 Agent Discovery\n'));
|
|
36
|
+
if (flags['dry-run']) {
|
|
37
|
+
this.log(chalk.yellow('Dry run mode - no changes will be made\n'));
|
|
38
|
+
}
|
|
24
39
|
}
|
|
25
40
|
const result = discoverAgentsOnDisk(workspaceInfo.path);
|
|
41
|
+
// JSON mode - output structured result
|
|
42
|
+
if (jsonMode) {
|
|
43
|
+
outputSuccessAsJson({
|
|
44
|
+
discovered: result.discovered.map(agent => ({
|
|
45
|
+
name: agent.name,
|
|
46
|
+
type: agent.type === 'persistent' ? 'staff' : 'temp',
|
|
47
|
+
path: agent.path,
|
|
48
|
+
})),
|
|
49
|
+
cleaned: result.cleaned,
|
|
50
|
+
inSync: result.discovered.length === 0 && result.cleaned.length === 0,
|
|
51
|
+
dryRun: flags['dry-run'],
|
|
52
|
+
}, createMetadata('agent discover', flags));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
26
55
|
// Report discovered agents
|
|
27
56
|
if (result.discovered.length > 0) {
|
|
28
57
|
this.log(chalk.green.bold(`✅ Discovered ${result.discovered.length} new agent(s):\n`));
|
|
@@ -61,6 +90,9 @@ export default class Discover extends Command {
|
|
|
61
90
|
}
|
|
62
91
|
}
|
|
63
92
|
catch (error) {
|
|
93
|
+
if (jsonMode) {
|
|
94
|
+
outputErrorAsJson('DISCOVER_FAILED', error instanceof Error ? error.message : String(error), createMetadata('agent discover', flags));
|
|
95
|
+
}
|
|
64
96
|
this.error(error instanceof Error ? error.message : String(error));
|
|
65
97
|
}
|
|
66
98
|
}
|
|
@@ -4,6 +4,7 @@ export default class Agent 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,8 +1,7 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
2
|
import { colors } from '../../lib/colors.js';
|
|
4
3
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
5
|
-
import { shouldOutputJson
|
|
4
|
+
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
6
5
|
export default class Agent extends PMOCommand {
|
|
7
6
|
static description = 'Manage agents in the workspace';
|
|
8
7
|
static examples = [
|
|
@@ -31,62 +30,37 @@ export default class Agent extends PMOCommand {
|
|
|
31
30
|
const { flags } = await this.parse(Agent);
|
|
32
31
|
// Check if JSON output mode is active
|
|
33
32
|
const jsonMode = shouldOutputJson(flags);
|
|
34
|
-
// Define choices for JSON mode (flat list with commands)
|
|
35
|
-
const menuChoices = [
|
|
36
|
-
{ id: 'list', name: 'List all agents', command: 'prlt agent list --format json' },
|
|
37
|
-
{ id: 'status', name: 'Show status', command: 'prlt agent status --json' },
|
|
38
|
-
{ id: 'visit', name: 'Visit directory', command: 'prlt agent visit --json' },
|
|
39
|
-
{ id: 'staff', name: 'Manage staff agents', command: 'prlt agent staff --json' },
|
|
40
|
-
{ id: 'temp', name: 'Manage temp agents', command: 'prlt agent temp --json' },
|
|
41
|
-
{ id: 'themes', name: 'Manage themes', command: 'prlt agent themes --json' },
|
|
42
|
-
{ id: 'shell', name: 'Open shell', command: 'prlt agent shell --json' },
|
|
43
|
-
{ id: 'restart', name: 'Restart', command: 'prlt agent restart --json' },
|
|
44
|
-
{ id: 'rebuild', name: 'Rebuild', command: 'prlt agent rebuild --json' },
|
|
45
|
-
{ id: 'discover', name: 'Discover agents on disk', command: 'prlt agent discover' },
|
|
46
|
-
{ id: 'cancel', name: 'Cancel', command: '' },
|
|
47
|
-
];
|
|
48
|
-
const message = 'What would you like to do?';
|
|
49
33
|
this.log(colors.primary('🤖 Agent Management'));
|
|
50
34
|
this.log('');
|
|
51
35
|
this.log(colors.textMuted('Note: Agent pre-registration is no longer required!'));
|
|
52
36
|
this.log(colors.textMuted('Use "prlt work spawn" to create ephemeral agents automatically.'));
|
|
53
37
|
this.log('');
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
// Agent mode config for prompts
|
|
39
|
+
const agentConfig = jsonMode ? { flags, commandName: 'agent' } : null;
|
|
40
|
+
// Use agentPrompt for unified JSON/interactive handling
|
|
41
|
+
const { action } = await this.prompt([{
|
|
57
42
|
type: 'list',
|
|
58
43
|
name: 'action',
|
|
59
|
-
message,
|
|
60
|
-
choices: menuChoices.map(c => ({ name: c.name, value: c.id, command: c.command })),
|
|
61
|
-
}, createMetadata('agent', flags));
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
// Interactive mode with separators for logical groupings
|
|
65
|
-
const { action } = await inquirer.prompt([{
|
|
66
|
-
type: 'list',
|
|
67
|
-
name: 'action',
|
|
68
|
-
message,
|
|
44
|
+
message: 'What would you like to do?',
|
|
69
45
|
choices: [
|
|
70
46
|
// View/Info group
|
|
71
|
-
{ name: '📋 List all agents', value: 'list' },
|
|
72
|
-
{ name: '📊 Show status', value: 'status' },
|
|
73
|
-
{ name: '📂 Visit directory', value: 'visit' },
|
|
74
|
-
|
|
47
|
+
{ name: '📋 List all agents', value: 'list', command: 'prlt agent list --machine' },
|
|
48
|
+
{ name: '📊 Show status', value: 'status', command: 'prlt agent status --machine' },
|
|
49
|
+
{ name: '📂 Visit directory', value: 'visit', command: 'prlt agent visit --machine' },
|
|
50
|
+
{ name: '🗑️ Remove agent', value: 'remove', command: 'prlt agent remove --machine' },
|
|
75
51
|
// Management group
|
|
76
|
-
{ name: '👔 Manage staff agents', value: 'staff' },
|
|
77
|
-
{ name: '⏱️ Manage temp agents', value: 'temp' },
|
|
78
|
-
{ name: '🎨 Manage themes', value: 'themes' },
|
|
79
|
-
new inquirer.Separator(),
|
|
52
|
+
{ name: '👔 Manage staff agents', value: 'staff', command: 'prlt agent staff --machine' },
|
|
53
|
+
{ name: '⏱️ Manage temp agents', value: 'temp', command: 'prlt agent temp --machine' },
|
|
54
|
+
{ name: '🎨 Manage themes', value: 'themes', command: 'prlt agent themes --machine' },
|
|
80
55
|
// Operations group
|
|
81
|
-
{ name: '🐚 Open shell', value: 'shell' },
|
|
82
|
-
{ name: '🔄 Restart', value: 'restart' },
|
|
83
|
-
{ name: '🔨 Rebuild', value: 'rebuild' },
|
|
84
|
-
{ name: '🔍 Discover agents on disk', value: 'discover' },
|
|
85
|
-
new inquirer.Separator(),
|
|
56
|
+
{ name: '🐚 Open shell', value: 'shell', command: 'prlt agent shell --machine' },
|
|
57
|
+
{ name: '🔄 Restart', value: 'restart', command: 'prlt agent restart --machine' },
|
|
58
|
+
{ name: '🔨 Rebuild', value: 'rebuild', command: 'prlt agent rebuild --machine' },
|
|
59
|
+
{ name: '🔍 Discover agents on disk', value: 'discover', command: 'prlt agent discover --machine' },
|
|
86
60
|
// Cancel
|
|
87
|
-
{ name: '❌ Cancel', value: 'cancel' },
|
|
61
|
+
{ name: '❌ Cancel', value: 'cancel', command: '' },
|
|
88
62
|
],
|
|
89
|
-
}]);
|
|
63
|
+
}], agentConfig);
|
|
90
64
|
if (action === 'cancel') {
|
|
91
65
|
this.log(colors.textMuted('Operation cancelled.'));
|
|
92
66
|
return;
|
|
@@ -113,6 +87,12 @@ export default class Agent extends PMOCommand {
|
|
|
113
87
|
await cmd.run();
|
|
114
88
|
break;
|
|
115
89
|
}
|
|
90
|
+
case 'remove': {
|
|
91
|
+
const { default: RemoveCommand } = await import('./remove.js');
|
|
92
|
+
const cmd = new RemoveCommand([], this.config);
|
|
93
|
+
await cmd.run();
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
116
96
|
case 'staff': {
|
|
117
97
|
const { default: StaffCommand } = await import('./staff/index.js');
|
|
118
98
|
const cmd = new StaffCommand([], this.config);
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class List extends
|
|
1
|
+
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
export default class List extends PMOCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
machine: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
10
|
};
|
|
9
|
-
|
|
11
|
+
protected getPMOOptions(): {
|
|
12
|
+
promptIfMultiple: boolean;
|
|
13
|
+
};
|
|
14
|
+
execute(): Promise<void>;
|
|
10
15
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import inquirer from 'inquirer';
|
|
4
3
|
import * as path from 'node:path';
|
|
5
4
|
import * as fs from 'node:fs';
|
|
6
5
|
import { getWorkspaceInfo, getAllAgentsStatus, getAgentTmuxSessions } from '../../lib/agents/commands.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
7
|
+
import { shouldOutputJson } from '../../lib/prompt-json.js';
|
|
8
|
+
export default class List extends PMOCommand {
|
|
9
9
|
static description = 'List all agents and their current status';
|
|
10
10
|
static examples = [
|
|
11
11
|
'<%= config.bin %> <%= command.id %>',
|
|
@@ -13,20 +13,22 @@ export default class List extends Command {
|
|
|
13
13
|
'<%= config.bin %> <%= command.id %> --type temp',
|
|
14
14
|
];
|
|
15
15
|
static flags = {
|
|
16
|
+
...pmoBaseFlags,
|
|
16
17
|
type: Flags.string({
|
|
17
18
|
char: 't',
|
|
18
19
|
description: 'Filter by agent type',
|
|
19
20
|
options: ['staff', 'temp', 'all'],
|
|
20
21
|
}),
|
|
21
|
-
json: Flags.boolean({
|
|
22
|
-
description: 'Output prompt configuration as JSON (for AI agents/scripts)',
|
|
23
|
-
default: false,
|
|
24
|
-
}),
|
|
25
22
|
};
|
|
26
|
-
|
|
23
|
+
getPMOOptions() {
|
|
24
|
+
return { promptIfMultiple: false };
|
|
25
|
+
}
|
|
26
|
+
async execute() {
|
|
27
27
|
try {
|
|
28
28
|
const { flags } = await this.parse(List);
|
|
29
29
|
const jsonMode = shouldOutputJson(flags);
|
|
30
|
+
// Agent mode config for prompts
|
|
31
|
+
const agentConfig = jsonMode ? { flags, commandName: 'agent list' } : null;
|
|
30
32
|
// Get workspace information
|
|
31
33
|
const workspaceInfo = getWorkspaceInfo();
|
|
32
34
|
// Filter to active agents only
|
|
@@ -34,31 +36,16 @@ export default class List extends Command {
|
|
|
34
36
|
// Determine type filter - prompt if not provided
|
|
35
37
|
let typeFilter = flags.type;
|
|
36
38
|
if (!typeFilter) {
|
|
37
|
-
|
|
38
|
-
if (jsonMode) {
|
|
39
|
-
outputPromptAsJson({
|
|
40
|
-
type: 'list',
|
|
41
|
-
name: 'type',
|
|
42
|
-
message: 'Which agents do you want to list?',
|
|
43
|
-
choices: [
|
|
44
|
-
{ name: 'All agents', value: 'all', command: 'prlt agent list --type all --json' },
|
|
45
|
-
{ name: 'Staff agents only', value: 'staff', command: 'prlt agent list --type staff --json' },
|
|
46
|
-
{ name: 'Temp agents only', value: 'temp', command: 'prlt agent list --type temp --json' },
|
|
47
|
-
],
|
|
48
|
-
}, createMetadata('agent list', flags));
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
// Interactive mode - prompt for type
|
|
52
|
-
const { selectedType } = await inquirer.prompt([{
|
|
39
|
+
const { selectedType } = await this.prompt([{
|
|
53
40
|
type: 'list',
|
|
54
41
|
name: 'selectedType',
|
|
55
42
|
message: 'Which agents do you want to list?',
|
|
56
43
|
choices: [
|
|
57
|
-
{ name: '📋 All agents', value: 'all' },
|
|
58
|
-
{ name: '👔 Staff agents only', value: 'staff' },
|
|
59
|
-
{ name: '⏱️ Temp agents only', value: 'temp' },
|
|
44
|
+
{ name: '📋 All agents', value: 'all', command: 'prlt agent list --type all --machine' },
|
|
45
|
+
{ name: '👔 Staff agents only', value: 'staff', command: 'prlt agent list --type staff --machine' },
|
|
46
|
+
{ name: '⏱️ Temp agents only', value: 'temp', command: 'prlt agent list --type temp --machine' },
|
|
60
47
|
],
|
|
61
|
-
}]);
|
|
48
|
+
}], agentConfig);
|
|
62
49
|
typeFilter = selectedType;
|
|
63
50
|
}
|
|
64
51
|
// Filter agents based on type selection
|
|
@@ -7,6 +7,7 @@ export default class Login 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(): {
|
|
@@ -2,12 +2,11 @@ import { Args, Flags } from '@oclif/core';
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
4
|
import { execSync } from 'node:child_process';
|
|
5
|
-
import inquirer from 'inquirer';
|
|
6
5
|
import { colors } from '../../lib/colors.js';
|
|
7
6
|
import { getWorkspaceInfo } from '../../lib/agents/commands.js';
|
|
8
7
|
import { PMOCommand, pmoBaseFlags } from '../../lib/pmo/index.js';
|
|
9
8
|
import { isDockerRunning, getAgentContainerName, isContainerRunning, getContainerId, } from '../../lib/execution/runners.js';
|
|
10
|
-
import { shouldOutputJson,
|
|
9
|
+
import { shouldOutputJson, outputErrorAsJson, createMetadata, } from '../../lib/prompt-json.js';
|
|
11
10
|
export default class Login extends PMOCommand {
|
|
12
11
|
static description = 'Authenticate Claude Code inside an agent container (one-time setup)';
|
|
13
12
|
static examples = [
|
|
@@ -34,17 +33,11 @@ export default class Login extends PMOCommand {
|
|
|
34
33
|
const { args, flags } = await this.parse(Login);
|
|
35
34
|
// Check if JSON output mode is active
|
|
36
35
|
const jsonMode = shouldOutputJson(flags);
|
|
37
|
-
//
|
|
38
|
-
const
|
|
39
|
-
if (jsonMode) {
|
|
40
|
-
outputErrorAsJson(code, message, createMetadata('agent login', flags));
|
|
41
|
-
this.exit(1);
|
|
42
|
-
}
|
|
43
|
-
this.error(message);
|
|
44
|
-
};
|
|
36
|
+
// Error handling config
|
|
37
|
+
const errorConfig = { jsonMode, commandName: 'agent login', flags };
|
|
45
38
|
// Check Docker is running
|
|
46
39
|
if (!isDockerRunning()) {
|
|
47
|
-
|
|
40
|
+
this.handleError('DOCKER_NOT_RUNNING', 'Docker is not running. Please start Docker Desktop and try again.', errorConfig);
|
|
48
41
|
}
|
|
49
42
|
// Get workspace information
|
|
50
43
|
const workspaceInfo = getWorkspaceInfo();
|
|
@@ -57,38 +50,27 @@ export default class Login extends PMOCommand {
|
|
|
57
50
|
return;
|
|
58
51
|
}
|
|
59
52
|
let agentName = args.name;
|
|
53
|
+
// Agent mode config for prompts
|
|
54
|
+
const agentConfig = jsonMode ? { flags, commandName: 'agent login' } : null;
|
|
60
55
|
// Interactive mode if no agent specified
|
|
61
56
|
if (!agentName) {
|
|
62
|
-
// In JSON mode, output agent selection prompt
|
|
63
|
-
if (jsonMode) {
|
|
64
|
-
const agentChoices = workspaceInfo.agents.map((agent) => ({ name: agent.name, value: agent.name }));
|
|
65
|
-
outputPromptAsJson(buildPromptConfig('list', 'name', 'Select agent to authenticate:', agentChoices), createMetadata('agent login', flags));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
57
|
// Group agents by type
|
|
69
58
|
const staffAgents = workspaceInfo.agents.filter(a => a.type === 'persistent');
|
|
70
59
|
const tempAgents = workspaceInfo.agents.filter(a => a.type === 'ephemeral');
|
|
60
|
+
// Build choices with command field for JSON mode
|
|
71
61
|
const choices = [];
|
|
72
|
-
|
|
73
|
-
choices.push(
|
|
74
|
-
for (const agent of staffAgents) {
|
|
75
|
-
choices.push({ name: `👔 ${agent.name}`, value: agent.name });
|
|
76
|
-
}
|
|
62
|
+
for (const agent of staffAgents) {
|
|
63
|
+
choices.push({ name: `👔 ${agent.name}`, value: agent.name, command: `prlt agent login ${agent.name} --machine` });
|
|
77
64
|
}
|
|
78
|
-
|
|
79
|
-
choices.push(
|
|
80
|
-
for (const agent of tempAgents) {
|
|
81
|
-
choices.push({ name: `⏱️ ${agent.name}`, value: agent.name });
|
|
82
|
-
}
|
|
65
|
+
for (const agent of tempAgents) {
|
|
66
|
+
choices.push({ name: `⏱️ ${agent.name}`, value: agent.name, command: `prlt agent login ${agent.name} --machine` });
|
|
83
67
|
}
|
|
84
|
-
const { selected } = await
|
|
85
|
-
{
|
|
68
|
+
const { selected } = await this.prompt([{
|
|
86
69
|
type: 'list',
|
|
87
70
|
name: 'selected',
|
|
88
71
|
message: 'Select agent to authenticate:',
|
|
89
|
-
choices
|
|
90
|
-
}
|
|
91
|
-
]);
|
|
72
|
+
choices,
|
|
73
|
+
}], agentConfig);
|
|
92
74
|
agentName = selected;
|
|
93
75
|
}
|
|
94
76
|
// Validate agent exists
|
|
@@ -8,6 +8,7 @@ export default class AgentRebuild extends PMOCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
'no-cache': 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(): {
|
|
@@ -15,7 +15,7 @@ export default class AgentRebuild extends PMOCommand {
|
|
|
15
15
|
'<%= config.bin %> <%= command.id %> altman',
|
|
16
16
|
'<%= config.bin %> <%= command.id %> altman --no-cache',
|
|
17
17
|
'<%= config.bin %> <%= command.id %> # Interactive selection',
|
|
18
|
-
'<%= config.bin %> <%= command.id %> --
|
|
18
|
+
'<%= config.bin %> <%= command.id %> --machine # JSON mode for AI agents',
|
|
19
19
|
];
|
|
20
20
|
static args = {
|
|
21
21
|
name: Args.string({
|
|
@@ -66,7 +66,7 @@ export default class AgentRebuild extends PMOCommand {
|
|
|
66
66
|
items: agents,
|
|
67
67
|
getName: (a) => a.name,
|
|
68
68
|
getValue: (a) => a.name,
|
|
69
|
-
getCommand: (a) => `prlt agent rebuild ${a.name} --
|
|
69
|
+
getCommand: (a) => `prlt agent rebuild ${a.name} --machine`,
|
|
70
70
|
jsonMode: jsonMode ? { flags, commandName: 'agent rebuild' } : null,
|
|
71
71
|
});
|
|
72
72
|
if (!selected) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PMOCommand } from '../../lib/pmo/index.js';
|
|
2
|
+
export default class Remove extends PMOCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
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
|
+
execute(): Promise<void>;
|
|
17
|
+
}
|