feat(HAI-001): update CLI task create to prompt for description instead of title
This commit is contained in:
@@ -8,25 +8,29 @@ async function getStore(): Promise<TaskStore> {
|
|||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function runTaskCreate(titleArg?: string) {
|
export async function runTaskCreate(descriptionArg?: string) {
|
||||||
let title = titleArg;
|
let description = descriptionArg;
|
||||||
|
|
||||||
if (!title) {
|
if (!description) {
|
||||||
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
||||||
title = await rl.question("Task title: ");
|
description = await rl.question("Task description: ");
|
||||||
rl.close();
|
rl.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!title?.trim()) {
|
if (!description?.trim()) {
|
||||||
console.error("Title is required");
|
console.error("Description is required");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const store = await getStore();
|
const store = await getStore();
|
||||||
const task = await store.createTask({ title: title.trim() });
|
const task = await store.createTask({ description: description.trim() });
|
||||||
|
|
||||||
|
const label = task.description.length > 60
|
||||||
|
? task.description.slice(0, 60) + "…"
|
||||||
|
: task.description;
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
console.log(` ✓ Created ${task.id}: ${task.title}`);
|
console.log(` ✓ Created ${task.id}: ${label}`);
|
||||||
console.log(` Column: triage`);
|
console.log(` Column: triage`);
|
||||||
console.log(` Path: .hai/tasks/${task.id}/`);
|
console.log(` Path: .hai/tasks/${task.id}/`);
|
||||||
console.log();
|
console.log();
|
||||||
|
|||||||
Reference in New Issue
Block a user