herdctl 0.0.1 → 0.0.2
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/bin/herdctl.js +9 -0
- package/dist/commands/__tests__/config.test.d.ts +2 -0
- package/dist/commands/__tests__/config.test.d.ts.map +1 -0
- package/dist/commands/__tests__/config.test.js +299 -0
- package/dist/commands/__tests__/config.test.js.map +1 -0
- package/dist/commands/__tests__/init.test.d.ts +2 -0
- package/dist/commands/__tests__/init.test.d.ts.map +1 -0
- package/dist/commands/__tests__/init.test.js +247 -0
- package/dist/commands/__tests__/init.test.js.map +1 -0
- package/dist/commands/__tests__/start.test.d.ts +2 -0
- package/dist/commands/__tests__/start.test.d.ts.map +1 -0
- package/dist/commands/__tests__/start.test.js +185 -0
- package/dist/commands/__tests__/start.test.js.map +1 -0
- package/dist/commands/__tests__/status.test.d.ts +2 -0
- package/dist/commands/__tests__/status.test.d.ts.map +1 -0
- package/dist/commands/__tests__/status.test.js +342 -0
- package/dist/commands/__tests__/status.test.js.map +1 -0
- package/dist/commands/__tests__/stop.test.d.ts +2 -0
- package/dist/commands/__tests__/stop.test.d.ts.map +1 -0
- package/dist/commands/__tests__/stop.test.js +229 -0
- package/dist/commands/__tests__/stop.test.js.map +1 -0
- package/dist/commands/__tests__/trigger.test.d.ts +2 -0
- package/dist/commands/__tests__/trigger.test.d.ts.map +1 -0
- package/dist/commands/__tests__/trigger.test.js +321 -0
- package/dist/commands/__tests__/trigger.test.js.map +1 -0
- package/dist/commands/cancel.d.ts +20 -0
- package/dist/commands/cancel.d.ts.map +1 -0
- package/dist/commands/cancel.js +263 -0
- package/dist/commands/cancel.js.map +1 -0
- package/dist/commands/config.d.ts +26 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +287 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/init.d.ts +16 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +305 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/job.d.ts +19 -0
- package/dist/commands/job.d.ts.map +1 -0
- package/dist/commands/job.js +460 -0
- package/dist/commands/job.js.map +1 -0
- package/dist/commands/jobs.d.ts +23 -0
- package/dist/commands/jobs.d.ts.map +1 -0
- package/dist/commands/jobs.js +328 -0
- package/dist/commands/jobs.js.map +1 -0
- package/dist/commands/logs.d.ts +25 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +360 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/start.d.ts +17 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +166 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +18 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +373 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/stop.d.ts +18 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +161 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/commands/trigger.d.ts +23 -0
- package/dist/commands/trigger.d.ts.map +1 -0
- package/dist/commands/trigger.js +332 -0
- package/dist/commands/trigger.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +283 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -7
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* herdctl trigger - Manually trigger an agent
|
|
3
|
+
*
|
|
4
|
+
* Commands:
|
|
5
|
+
* - herdctl trigger <agent> Trigger with default schedule
|
|
6
|
+
* - herdctl trigger <agent> --schedule <name> Trigger specific schedule
|
|
7
|
+
* - herdctl trigger <agent> --prompt "..." Custom prompt
|
|
8
|
+
* - herdctl trigger <agent> --wait Wait for job to complete
|
|
9
|
+
* - herdctl trigger <agent> --json JSON output
|
|
10
|
+
*/
|
|
11
|
+
import { FleetManager, ConfigNotFoundError, isFleetManagerError, isAgentNotFoundError, isScheduleNotFoundError, isConcurrencyLimitError, } from "@herdctl/core";
|
|
12
|
+
/**
|
|
13
|
+
* Default state directory
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_STATE_DIR = ".herdctl";
|
|
16
|
+
/**
|
|
17
|
+
* Check if colors should be disabled
|
|
18
|
+
*/
|
|
19
|
+
function shouldUseColor() {
|
|
20
|
+
// NO_COLOR takes precedence (https://no-color.org/)
|
|
21
|
+
if (process.env.NO_COLOR !== undefined && process.env.NO_COLOR !== "") {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
// Also check FORCE_COLOR for override
|
|
25
|
+
if (process.env.FORCE_COLOR !== undefined && process.env.FORCE_COLOR !== "0") {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
// Check if stdout is a TTY
|
|
29
|
+
return process.stdout.isTTY === true;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* ANSI color codes
|
|
33
|
+
*/
|
|
34
|
+
const colors = {
|
|
35
|
+
reset: "\x1b[0m",
|
|
36
|
+
bold: "\x1b[1m",
|
|
37
|
+
dim: "\x1b[2m",
|
|
38
|
+
green: "\x1b[32m",
|
|
39
|
+
yellow: "\x1b[33m",
|
|
40
|
+
red: "\x1b[31m",
|
|
41
|
+
cyan: "\x1b[36m",
|
|
42
|
+
gray: "\x1b[90m",
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get a colored string, respecting NO_COLOR
|
|
46
|
+
*/
|
|
47
|
+
function colorize(text, color) {
|
|
48
|
+
if (!shouldUseColor()) {
|
|
49
|
+
return text;
|
|
50
|
+
}
|
|
51
|
+
return `${colors[color]}${text}${colors.reset}`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Format timestamp to local timezone
|
|
55
|
+
*/
|
|
56
|
+
function formatTimestamp(isoTimestamp) {
|
|
57
|
+
const date = new Date(isoTimestamp);
|
|
58
|
+
return date.toLocaleString(undefined, {
|
|
59
|
+
hour: "2-digit",
|
|
60
|
+
minute: "2-digit",
|
|
61
|
+
second: "2-digit",
|
|
62
|
+
hour12: false,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Format a log entry for console output with colors
|
|
67
|
+
*/
|
|
68
|
+
function formatLogEntry(entry) {
|
|
69
|
+
const timestamp = colorize(formatTimestamp(entry.timestamp), "dim");
|
|
70
|
+
const message = entry.message;
|
|
71
|
+
return `${timestamp} ${message}`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Trigger an agent (herdctl trigger)
|
|
75
|
+
*/
|
|
76
|
+
export async function triggerCommand(agentName, options) {
|
|
77
|
+
const stateDir = options.state || DEFAULT_STATE_DIR;
|
|
78
|
+
const isJsonOutput = options.json === true;
|
|
79
|
+
const isWaitMode = options.wait === true;
|
|
80
|
+
// Create FleetManager
|
|
81
|
+
const manager = new FleetManager({
|
|
82
|
+
configPath: options.config,
|
|
83
|
+
stateDir,
|
|
84
|
+
});
|
|
85
|
+
// Track if we're shutting down
|
|
86
|
+
let isShuttingDown = false;
|
|
87
|
+
/**
|
|
88
|
+
* Graceful shutdown handler
|
|
89
|
+
*/
|
|
90
|
+
function shutdown() {
|
|
91
|
+
if (isShuttingDown) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
isShuttingDown = true;
|
|
95
|
+
if (!isJsonOutput) {
|
|
96
|
+
console.log("");
|
|
97
|
+
console.log(colorize("Interrupted. Job continues running in background.", "yellow"));
|
|
98
|
+
}
|
|
99
|
+
process.exit(130); // 128 + SIGINT (2)
|
|
100
|
+
}
|
|
101
|
+
// Register signal handlers for wait mode
|
|
102
|
+
if (isWaitMode) {
|
|
103
|
+
process.on("SIGINT", shutdown);
|
|
104
|
+
process.on("SIGTERM", shutdown);
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
// Initialize to load configuration
|
|
108
|
+
await manager.initialize();
|
|
109
|
+
// Trigger the agent
|
|
110
|
+
let result;
|
|
111
|
+
try {
|
|
112
|
+
result = await manager.trigger(agentName, options.schedule, {
|
|
113
|
+
prompt: options.prompt,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
// Handle specific trigger errors
|
|
118
|
+
if (isAgentNotFoundError(error)) {
|
|
119
|
+
if (isJsonOutput) {
|
|
120
|
+
console.log(JSON.stringify({
|
|
121
|
+
error: {
|
|
122
|
+
code: "AGENT_NOT_FOUND",
|
|
123
|
+
message: error.message,
|
|
124
|
+
agentName: agentName,
|
|
125
|
+
},
|
|
126
|
+
}));
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
129
|
+
console.error("");
|
|
130
|
+
console.error(`Error: Agent '${agentName}' not found.`);
|
|
131
|
+
console.error("");
|
|
132
|
+
console.error("Run 'herdctl status' to see all agents.");
|
|
133
|
+
process.exit(1);
|
|
134
|
+
}
|
|
135
|
+
if (isScheduleNotFoundError(error)) {
|
|
136
|
+
if (isJsonOutput) {
|
|
137
|
+
console.log(JSON.stringify({
|
|
138
|
+
error: {
|
|
139
|
+
code: "SCHEDULE_NOT_FOUND",
|
|
140
|
+
message: error.message,
|
|
141
|
+
agentName: agentName,
|
|
142
|
+
scheduleName: options.schedule,
|
|
143
|
+
},
|
|
144
|
+
}));
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
console.error("");
|
|
148
|
+
console.error(`Error: Schedule '${options.schedule}' not found for agent '${agentName}'.`);
|
|
149
|
+
console.error("");
|
|
150
|
+
console.error(`Run 'herdctl status ${agentName}' to see available schedules.`);
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
if (isConcurrencyLimitError(error)) {
|
|
154
|
+
if (isJsonOutput) {
|
|
155
|
+
console.log(JSON.stringify({
|
|
156
|
+
error: {
|
|
157
|
+
code: "CONCURRENCY_LIMIT",
|
|
158
|
+
message: error.message,
|
|
159
|
+
agentName: agentName,
|
|
160
|
+
},
|
|
161
|
+
}));
|
|
162
|
+
process.exit(1);
|
|
163
|
+
}
|
|
164
|
+
console.error("");
|
|
165
|
+
console.error(`Error: Agent '${agentName}' is at concurrency limit.`);
|
|
166
|
+
console.error(error.message);
|
|
167
|
+
console.error("");
|
|
168
|
+
console.error("Wait for current jobs to complete or check 'herdctl status'.");
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
// Show job ID immediately
|
|
174
|
+
if (isJsonOutput) {
|
|
175
|
+
const output = {
|
|
176
|
+
success: true,
|
|
177
|
+
job: {
|
|
178
|
+
id: result.jobId,
|
|
179
|
+
agent: result.agentName,
|
|
180
|
+
schedule: result.scheduleName,
|
|
181
|
+
startedAt: result.startedAt,
|
|
182
|
+
prompt: result.prompt,
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
console.log(JSON.stringify(output));
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
console.log("");
|
|
189
|
+
console.log(colorize("Job triggered successfully", "green"));
|
|
190
|
+
console.log(`Job ID: ${colorize(result.jobId, "cyan")}`);
|
|
191
|
+
console.log(`Agent: ${result.agentName}`);
|
|
192
|
+
if (result.scheduleName) {
|
|
193
|
+
console.log(`Schedule: ${result.scheduleName}`);
|
|
194
|
+
}
|
|
195
|
+
if (result.prompt) {
|
|
196
|
+
const truncatedPrompt = result.prompt.length > 60
|
|
197
|
+
? result.prompt.substring(0, 60) + "..."
|
|
198
|
+
: result.prompt;
|
|
199
|
+
console.log(`Prompt: ${colorize(truncatedPrompt, "dim")}`);
|
|
200
|
+
}
|
|
201
|
+
console.log("");
|
|
202
|
+
}
|
|
203
|
+
// If not wait mode, we're done
|
|
204
|
+
if (!isWaitMode) {
|
|
205
|
+
if (!isJsonOutput) {
|
|
206
|
+
console.log(`Run 'herdctl logs --job ${result.jobId}' to view output.`);
|
|
207
|
+
console.log(`Run 'herdctl trigger ${agentName} --wait' to wait for completion.`);
|
|
208
|
+
}
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
// Wait mode: stream job output until completion
|
|
212
|
+
if (!isJsonOutput) {
|
|
213
|
+
console.log(colorize("Streaming job output...", "dim"));
|
|
214
|
+
console.log("");
|
|
215
|
+
}
|
|
216
|
+
let exitCode = 0;
|
|
217
|
+
let jobStatus = "completed";
|
|
218
|
+
let finishedAt;
|
|
219
|
+
try {
|
|
220
|
+
// Stream job output
|
|
221
|
+
for await (const entry of manager.streamJobOutput(result.jobId)) {
|
|
222
|
+
if (isShuttingDown) {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
if (isJsonOutput) {
|
|
226
|
+
console.log(JSON.stringify(entry));
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
console.log(formatLogEntry(entry));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Job stream ended - fetch final job status
|
|
233
|
+
// Note: In a full implementation, we would fetch the job metadata here
|
|
234
|
+
// to get the actual exit code and status. For now, we assume success
|
|
235
|
+
// if the stream completed without error.
|
|
236
|
+
finishedAt = new Date().toISOString();
|
|
237
|
+
}
|
|
238
|
+
catch (streamError) {
|
|
239
|
+
// Stream error - job may have failed
|
|
240
|
+
if (!isShuttingDown) {
|
|
241
|
+
exitCode = 1;
|
|
242
|
+
jobStatus = "error";
|
|
243
|
+
finishedAt = new Date().toISOString();
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// Output final status in JSON mode
|
|
247
|
+
if (isJsonOutput && !isShuttingDown) {
|
|
248
|
+
const output = {
|
|
249
|
+
success: exitCode === 0,
|
|
250
|
+
job: {
|
|
251
|
+
id: result.jobId,
|
|
252
|
+
agent: result.agentName,
|
|
253
|
+
schedule: result.scheduleName,
|
|
254
|
+
startedAt: result.startedAt,
|
|
255
|
+
finishedAt,
|
|
256
|
+
exitCode,
|
|
257
|
+
status: jobStatus,
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
// Print a newline before final status in JSON mode
|
|
261
|
+
console.log("");
|
|
262
|
+
console.log(JSON.stringify(output));
|
|
263
|
+
}
|
|
264
|
+
else if (!isShuttingDown) {
|
|
265
|
+
console.log("");
|
|
266
|
+
if (exitCode === 0) {
|
|
267
|
+
console.log(colorize("Job completed successfully.", "green"));
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
console.log(colorize(`Job finished with exit code ${exitCode}.`, "red"));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Exit with job's exit code
|
|
274
|
+
process.exit(exitCode);
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
// Handle specific error types
|
|
278
|
+
if (error instanceof ConfigNotFoundError) {
|
|
279
|
+
if (isJsonOutput) {
|
|
280
|
+
console.log(JSON.stringify({
|
|
281
|
+
error: {
|
|
282
|
+
code: "CONFIG_NOT_FOUND",
|
|
283
|
+
message: "No configuration file found",
|
|
284
|
+
startDirectory: error.startDirectory,
|
|
285
|
+
},
|
|
286
|
+
}));
|
|
287
|
+
process.exit(1);
|
|
288
|
+
}
|
|
289
|
+
console.error("");
|
|
290
|
+
console.error("Error: No configuration file found.");
|
|
291
|
+
console.error(`Searched from: ${error.startDirectory}`);
|
|
292
|
+
console.error("");
|
|
293
|
+
console.error("Run 'herdctl init' to create a configuration file.");
|
|
294
|
+
process.exit(1);
|
|
295
|
+
}
|
|
296
|
+
if (isFleetManagerError(error)) {
|
|
297
|
+
if (isJsonOutput) {
|
|
298
|
+
console.log(JSON.stringify({
|
|
299
|
+
error: {
|
|
300
|
+
code: error.code,
|
|
301
|
+
message: error.message,
|
|
302
|
+
},
|
|
303
|
+
}));
|
|
304
|
+
process.exit(1);
|
|
305
|
+
}
|
|
306
|
+
console.error("");
|
|
307
|
+
console.error(`Error: ${error.message}`);
|
|
308
|
+
if (error.code) {
|
|
309
|
+
console.error(`Code: ${error.code}`);
|
|
310
|
+
}
|
|
311
|
+
process.exit(1);
|
|
312
|
+
}
|
|
313
|
+
// Handle interruption during shutdown gracefully
|
|
314
|
+
if (isShuttingDown) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
// Generic error
|
|
318
|
+
if (isJsonOutput) {
|
|
319
|
+
console.log(JSON.stringify({
|
|
320
|
+
error: {
|
|
321
|
+
code: "UNKNOWN_ERROR",
|
|
322
|
+
message: error instanceof Error ? error.message : String(error),
|
|
323
|
+
},
|
|
324
|
+
}));
|
|
325
|
+
process.exit(1);
|
|
326
|
+
}
|
|
327
|
+
console.error("");
|
|
328
|
+
console.error("Error:", error instanceof Error ? error.message : String(error));
|
|
329
|
+
process.exit(1);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
//# sourceMappingURL=trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../src/commands/trigger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,GAGxB,MAAM,eAAe,CAAC;AAWvB;;GAEG;AACH,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAErC;;GAEG;AACH,SAAS,cAAc;IACrB,oDAAoD;IACpD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,sCAAsC;IACtC,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,GAAG,EAAE,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2BAA2B;IAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SA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|
|
2
|
+
/**
|
|
3
|
+
* herdctl - Autonomous Agent Fleet Management for Claude Code
|
|
4
|
+
*
|
|
5
|
+
* Commands (PRD 6):
|
|
6
|
+
* - herdctl init Initialize a new herdctl project
|
|
7
|
+
* - herdctl start [agent] Start all agents or a specific agent
|
|
8
|
+
* - herdctl stop [agent] Stop all agents or a specific agent
|
|
9
|
+
* - herdctl status [agent] Show fleet or agent status
|
|
10
|
+
* - herdctl logs [agent] Tail agent logs
|
|
11
|
+
* - herdctl trigger <agent> Manually trigger an agent
|
|
12
|
+
*
|
|
13
|
+
* Commands (PRD 7):
|
|
14
|
+
* - herdctl config validate Validate configuration
|
|
15
|
+
* - herdctl config show Show resolved configuration
|
|
16
|
+
*
|
|
17
|
+
* Commands (PRD 8 - Job Management):
|
|
18
|
+
* - herdctl jobs List recent jobs
|
|
19
|
+
* - herdctl job <id> Show job details
|
|
20
|
+
* - herdctl cancel <id> Cancel running job
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* herdctl - Autonomous Agent Fleet Management for Claude Code
|
|
4
|
+
*
|
|
5
|
+
* Commands (PRD 6):
|
|
6
|
+
* - herdctl init Initialize a new herdctl project
|
|
7
|
+
* - herdctl start [agent] Start all agents or a specific agent
|
|
8
|
+
* - herdctl stop [agent] Stop all agents or a specific agent
|
|
9
|
+
* - herdctl status [agent] Show fleet or agent status
|
|
10
|
+
* - herdctl logs [agent] Tail agent logs
|
|
11
|
+
* - herdctl trigger <agent> Manually trigger an agent
|
|
12
|
+
*
|
|
13
|
+
* Commands (PRD 7):
|
|
14
|
+
* - herdctl config validate Validate configuration
|
|
15
|
+
* - herdctl config show Show resolved configuration
|
|
16
|
+
*
|
|
17
|
+
* Commands (PRD 8 - Job Management):
|
|
18
|
+
* - herdctl jobs List recent jobs
|
|
19
|
+
* - herdctl job <id> Show job details
|
|
20
|
+
* - herdctl cancel <id> Cancel running job
|
|
21
|
+
*/
|
|
22
|
+
import { Command } from "commander";
|
|
23
|
+
import { VERSION } from "@herdctl/core";
|
|
24
|
+
import { initCommand } from "./commands/init.js";
|
|
25
|
+
import { startCommand } from "./commands/start.js";
|
|
26
|
+
import { stopCommand } from "./commands/stop.js";
|
|
27
|
+
import { configValidateCommand, configShowCommand } from "./commands/config.js";
|
|
28
|
+
import { statusCommand } from "./commands/status.js";
|
|
29
|
+
import { logsCommand } from "./commands/logs.js";
|
|
30
|
+
import { triggerCommand } from "./commands/trigger.js";
|
|
31
|
+
import { jobsCommand } from "./commands/jobs.js";
|
|
32
|
+
import { jobCommand } from "./commands/job.js";
|
|
33
|
+
import { cancelCommand } from "./commands/cancel.js";
|
|
34
|
+
const program = new Command();
|
|
35
|
+
program
|
|
36
|
+
.name("herdctl")
|
|
37
|
+
.description("Autonomous Agent Fleet Management for Claude Code")
|
|
38
|
+
.version(VERSION);
|
|
39
|
+
program
|
|
40
|
+
.command("init")
|
|
41
|
+
.description("Initialize a new herdctl project")
|
|
42
|
+
.option("-n, --name <name>", "Fleet name")
|
|
43
|
+
.option("-e, --example <template>", "Use example template (simple, quickstart, github)")
|
|
44
|
+
.option("-y, --yes", "Accept all defaults without prompting")
|
|
45
|
+
.option("-f, --force", "Overwrite existing configuration")
|
|
46
|
+
.action(async (options) => {
|
|
47
|
+
try {
|
|
48
|
+
await initCommand(options);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
52
|
+
console.log("\nAborted.");
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
program
|
|
59
|
+
.command("start")
|
|
60
|
+
.description("Start the fleet")
|
|
61
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
62
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
63
|
+
.action(async (options) => {
|
|
64
|
+
try {
|
|
65
|
+
await startCommand(options);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
69
|
+
console.log("\nAborted.");
|
|
70
|
+
process.exit(0);
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
program
|
|
76
|
+
.command("stop")
|
|
77
|
+
.description("Stop the fleet")
|
|
78
|
+
.option("-f, --force", "Immediate stop (cancel jobs)")
|
|
79
|
+
.option("-t, --timeout <seconds>", "Wait max seconds before force kill", "30")
|
|
80
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
81
|
+
.action(async (options) => {
|
|
82
|
+
try {
|
|
83
|
+
await stopCommand({
|
|
84
|
+
force: options.force,
|
|
85
|
+
timeout: parseInt(options.timeout, 10),
|
|
86
|
+
state: options.state,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (error instanceof Error && error.message.includes("process.exit")) {
|
|
91
|
+
// Let the process.exit call in stopCommand handle this
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
console.error("Error:", error instanceof Error ? error.message : String(error));
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
program
|
|
99
|
+
.command("status [agent]")
|
|
100
|
+
.description("Show fleet status or agent details")
|
|
101
|
+
.option("--json", "Output as JSON for scripting")
|
|
102
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
103
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
104
|
+
.action(async (agent, options) => {
|
|
105
|
+
try {
|
|
106
|
+
await statusCommand(agent, options);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
110
|
+
console.log("\nAborted.");
|
|
111
|
+
process.exit(0);
|
|
112
|
+
}
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
program
|
|
117
|
+
.command("logs [agent]")
|
|
118
|
+
.description("Show agent logs")
|
|
119
|
+
.option("-f, --follow", "Follow log output continuously")
|
|
120
|
+
.option("--job <id>", "Logs from specific job")
|
|
121
|
+
.option("-n, --lines <count>", "Number of lines to show (default: 50)")
|
|
122
|
+
.option("--json", "Output as newline-delimited JSON")
|
|
123
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
124
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
125
|
+
.action(async (agent, options) => {
|
|
126
|
+
try {
|
|
127
|
+
await logsCommand(agent, options);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
131
|
+
console.log("\nAborted.");
|
|
132
|
+
process.exit(0);
|
|
133
|
+
}
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
program
|
|
138
|
+
.command("trigger <agent>")
|
|
139
|
+
.description("Manually trigger an agent")
|
|
140
|
+
.option("-S, --schedule <name>", "Trigger specific schedule")
|
|
141
|
+
.option("-p, --prompt <prompt>", "Custom prompt")
|
|
142
|
+
.option("-w, --wait", "Wait for job to complete")
|
|
143
|
+
.option("--json", "Output as JSON for scripting")
|
|
144
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
145
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
146
|
+
.action(async (agent, options) => {
|
|
147
|
+
try {
|
|
148
|
+
await triggerCommand(agent, {
|
|
149
|
+
schedule: options.schedule,
|
|
150
|
+
prompt: options.prompt,
|
|
151
|
+
wait: options.wait,
|
|
152
|
+
json: options.json,
|
|
153
|
+
config: options.config,
|
|
154
|
+
state: options.state,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
159
|
+
console.log("\nAborted.");
|
|
160
|
+
process.exit(0);
|
|
161
|
+
}
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
// Job management commands (PRD 8)
|
|
166
|
+
program
|
|
167
|
+
.command("jobs")
|
|
168
|
+
.description("List recent jobs")
|
|
169
|
+
.option("-a, --agent <name>", "Filter by agent name")
|
|
170
|
+
.option("-S, --status <status>", "Filter by status (pending, running, completed, failed, cancelled)")
|
|
171
|
+
.option("-l, --limit <count>", "Number of jobs to show (default: 20)")
|
|
172
|
+
.option("--json", "Output as JSON for scripting")
|
|
173
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
174
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
175
|
+
.action(async (options) => {
|
|
176
|
+
try {
|
|
177
|
+
await jobsCommand({
|
|
178
|
+
agent: options.agent,
|
|
179
|
+
status: options.status,
|
|
180
|
+
limit: options.limit ? parseInt(options.limit, 10) : undefined,
|
|
181
|
+
json: options.json,
|
|
182
|
+
config: options.config,
|
|
183
|
+
state: options.state,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
188
|
+
console.log("\nAborted.");
|
|
189
|
+
process.exit(0);
|
|
190
|
+
}
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
program
|
|
195
|
+
.command("job <id>")
|
|
196
|
+
.description("Show job details")
|
|
197
|
+
.option("-L, --logs", "Show job output")
|
|
198
|
+
.option("--json", "Output as JSON for scripting")
|
|
199
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
200
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
201
|
+
.action(async (id, options) => {
|
|
202
|
+
try {
|
|
203
|
+
await jobCommand(id, {
|
|
204
|
+
logs: options.logs,
|
|
205
|
+
json: options.json,
|
|
206
|
+
config: options.config,
|
|
207
|
+
state: options.state,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
212
|
+
console.log("\nAborted.");
|
|
213
|
+
process.exit(0);
|
|
214
|
+
}
|
|
215
|
+
throw error;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
program
|
|
219
|
+
.command("cancel <id>")
|
|
220
|
+
.description("Cancel a running job")
|
|
221
|
+
.option("-f, --force", "Force cancel (SIGKILL)")
|
|
222
|
+
.option("-y, --yes", "Skip confirmation prompt")
|
|
223
|
+
.option("--json", "Output as JSON for scripting")
|
|
224
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
225
|
+
.option("-s, --state <path>", "Path to state directory (default: .herdctl)")
|
|
226
|
+
.action(async (id, options) => {
|
|
227
|
+
try {
|
|
228
|
+
await cancelCommand(id, {
|
|
229
|
+
force: options.force,
|
|
230
|
+
yes: options.yes,
|
|
231
|
+
json: options.json,
|
|
232
|
+
config: options.config,
|
|
233
|
+
state: options.state,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
238
|
+
console.log("\nAborted.");
|
|
239
|
+
process.exit(0);
|
|
240
|
+
}
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
// Config command group
|
|
245
|
+
const configCmd = program
|
|
246
|
+
.command("config")
|
|
247
|
+
.description("Configuration management commands");
|
|
248
|
+
configCmd
|
|
249
|
+
.command("validate")
|
|
250
|
+
.description("Validate the current configuration")
|
|
251
|
+
.option("--fix", "Show suggestions for fixes")
|
|
252
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
253
|
+
.action(async (options) => {
|
|
254
|
+
try {
|
|
255
|
+
await configValidateCommand(options);
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
259
|
+
console.log("\nAborted.");
|
|
260
|
+
process.exit(0);
|
|
261
|
+
}
|
|
262
|
+
throw error;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
configCmd
|
|
266
|
+
.command("show")
|
|
267
|
+
.description("Show merged/resolved configuration")
|
|
268
|
+
.option("--json", "Output as JSON")
|
|
269
|
+
.option("-c, --config <path>", "Path to config file or directory")
|
|
270
|
+
.action(async (options) => {
|
|
271
|
+
try {
|
|
272
|
+
await configShowCommand(options);
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
if (error instanceof Error && error.message.includes("User force closed")) {
|
|
276
|
+
console.log("\nAborted.");
|
|
277
|
+
process.exit(0);
|
|
278
|
+
}
|
|
279
|
+
throw error;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
program.parse();
|
|
283
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WA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