@simonfestl/husky-cli 0.9.6 → 0.9.7
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/llm-context.js +6 -2
- package/dist/commands/task.js +35 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* LLM Context Generator
|
|
3
3
|
* Outputs markdown reference for LLM agents
|
|
4
4
|
*/
|
|
5
|
-
const VERSION = "0.9.
|
|
5
|
+
const VERSION = "0.9.7";
|
|
6
6
|
export function generateLLMContext() {
|
|
7
7
|
return `# Husky CLI Reference (v${VERSION})
|
|
8
8
|
|
|
@@ -54,11 +54,15 @@ husky config test
|
|
|
54
54
|
husky task list [--status <status>] # List tasks
|
|
55
55
|
husky task get <id> # Get task details
|
|
56
56
|
husky task create # Create new task
|
|
57
|
-
husky task start <id> # Start
|
|
57
|
+
husky task start <id> # Start task (auto-creates worktree!)
|
|
58
|
+
husky task start <id> --no-worktree # Start without worktree
|
|
58
59
|
husky task done <id> [--pr <url>] # Mark task as done
|
|
59
60
|
husky task update <id> # Update task fields
|
|
60
61
|
husky task assign <id> <assignee> # Assign task
|
|
61
62
|
husky task log <id> # View task activity log
|
|
63
|
+
husky task message <id> "msg" # Post status message (positional)
|
|
64
|
+
husky task message -m "msg" --id <id> # Post status message (flags)
|
|
65
|
+
husky task message -m "msg" # Uses HUSKY_TASK_ID env var
|
|
62
66
|
\`\`\`
|
|
63
67
|
|
|
64
68
|
### Projects
|
package/dist/commands/task.js
CHANGED
|
@@ -221,7 +221,8 @@ taskCommand
|
|
|
221
221
|
taskCommand
|
|
222
222
|
.command("start <id>")
|
|
223
223
|
.description("Start working on a task")
|
|
224
|
-
.
|
|
224
|
+
.option("--no-worktree", "Skip worktree creation")
|
|
225
|
+
.action(async (id, options) => {
|
|
225
226
|
const config = getConfig();
|
|
226
227
|
if (!config.apiUrl) {
|
|
227
228
|
console.error("Error: API URL not configured.");
|
|
@@ -232,6 +233,15 @@ taskCommand
|
|
|
232
233
|
const workerId = await ensureWorkerRegistered(config.apiUrl, config.apiKey || "");
|
|
233
234
|
const sessionId = generateSessionId();
|
|
234
235
|
await registerSession(config.apiUrl, config.apiKey || "", workerId, sessionId);
|
|
236
|
+
// Create worktree for isolation (unless --no-worktree)
|
|
237
|
+
let worktreeInfo = null;
|
|
238
|
+
if (options.worktree !== false) {
|
|
239
|
+
worktreeInfo = createWorktreeForTask(id);
|
|
240
|
+
if (worktreeInfo) {
|
|
241
|
+
console.log(`✓ Created worktree: ${worktreeInfo.path}`);
|
|
242
|
+
console.log(` Branch: ${worktreeInfo.branch}`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
235
245
|
const res = await fetch(`${config.apiUrl}/api/tasks/${id}/start`, {
|
|
236
246
|
method: "POST",
|
|
237
247
|
headers: {
|
|
@@ -242,6 +252,11 @@ taskCommand
|
|
|
242
252
|
agent: "claude-code",
|
|
243
253
|
workerId,
|
|
244
254
|
sessionId,
|
|
255
|
+
// Include worktree info if created
|
|
256
|
+
...(worktreeInfo ? {
|
|
257
|
+
worktreePath: worktreeInfo.path,
|
|
258
|
+
worktreeBranch: worktreeInfo.branch,
|
|
259
|
+
} : {}),
|
|
245
260
|
}),
|
|
246
261
|
});
|
|
247
262
|
if (!res.ok) {
|
|
@@ -251,6 +266,10 @@ taskCommand
|
|
|
251
266
|
console.log(`✓ Started: ${task.title}`);
|
|
252
267
|
console.log(` Worker: ${workerId}`);
|
|
253
268
|
console.log(` Session: ${sessionId}`);
|
|
269
|
+
// Show hint to cd into worktree
|
|
270
|
+
if (worktreeInfo) {
|
|
271
|
+
console.log(`\n💡 To work in isolation: cd ${worktreeInfo.path}`);
|
|
272
|
+
}
|
|
254
273
|
}
|
|
255
274
|
catch (error) {
|
|
256
275
|
console.error("Error starting task:", error);
|
|
@@ -547,11 +566,23 @@ taskCommand
|
|
|
547
566
|
});
|
|
548
567
|
// husky task message <id> "message" - post status message to task
|
|
549
568
|
taskCommand
|
|
550
|
-
.command("message
|
|
569
|
+
.command("message [id] [message]")
|
|
551
570
|
.description("Post a status message to a task")
|
|
552
|
-
.
|
|
571
|
+
.option("-m, --message <text>", "Message text (alternative to positional arg)")
|
|
572
|
+
.option("--id <taskId>", "Task ID (alternative to positional arg, or use HUSKY_TASK_ID)")
|
|
573
|
+
.action(async (idArg, messageArg, options) => {
|
|
553
574
|
const config = ensureConfig();
|
|
554
|
-
|
|
575
|
+
// Support both: `husky task message <id> <msg>` and `husky task message -m <msg> --id <id>`
|
|
576
|
+
const taskId = idArg || options.id || process.env.HUSKY_TASK_ID;
|
|
577
|
+
const message = messageArg || options.message;
|
|
578
|
+
if (!taskId) {
|
|
579
|
+
console.error("Error: Task ID required. Use positional arg, --id, or set HUSKY_TASK_ID");
|
|
580
|
+
process.exit(1);
|
|
581
|
+
}
|
|
582
|
+
if (!message) {
|
|
583
|
+
console.error("Error: Message required. Use positional arg or -m/--message");
|
|
584
|
+
process.exit(1);
|
|
585
|
+
}
|
|
555
586
|
try {
|
|
556
587
|
const res = await fetch(`${config.apiUrl}/api/tasks/${taskId}/status`, {
|
|
557
588
|
method: "POST",
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ const program = new Command();
|
|
|
28
28
|
program
|
|
29
29
|
.name("husky")
|
|
30
30
|
.description("CLI for Huskyv0 Task Orchestration with Claude Agent")
|
|
31
|
-
.version("0.9.
|
|
31
|
+
.version("0.9.7")
|
|
32
32
|
.option("--llm", "Output LLM reference documentation (markdown)");
|
|
33
33
|
program.addCommand(taskCommand);
|
|
34
34
|
program.addCommand(configCommand);
|