feat(KB-127): add --depends flag to task create CLI command

- Add --depends flag to task create command in bin.ts and task.ts
- Support setting task dependencies at creation time via CLI
- Add tests for --depends flag including single and multiple dependencies
- Include changeset for the new CLI feature
This commit is contained in:
Dustin Byrne
2026-03-27 01:53:30 -04:00
parent 741964f271
commit 7170e5ba55
4 changed files with 81 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ async function getStore(): Promise<TaskStore> {
return store;
}
export async function runTaskCreate(descriptionArg?: string, attachFiles?: string[]) {
export async function runTaskCreate(descriptionArg?: string, attachFiles?: string[], depends?: string[]) {
let description = descriptionArg;
if (!description) {
@@ -25,7 +25,7 @@ export async function runTaskCreate(descriptionArg?: string, attachFiles?: strin
}
const store = await getStore();
const task = await store.createTask({ description: description.trim() });
const task = await store.createTask({ description: description.trim(), dependencies: depends });
const label = task.description.length > 60
? task.description.slice(0, 60) + "…"
@@ -34,6 +34,9 @@ export async function runTaskCreate(descriptionArg?: string, attachFiles?: strin
console.log();
console.log(` ✓ Created ${task.id}: ${label}`);
console.log(` Column: triage`);
if (task.dependencies.length > 0) {
console.log(` Dependencies: ${task.dependencies.join(", ")}`);
}
console.log(` Path: .kb/tasks/${task.id}/`);
if (attachFiles && attachFiles.length > 0) {