feat(cli): add initiative phases command
Add cw initiative phases <initiativeId> to list phases for an initiative. Displays phase number, name, status, and description.
This commit is contained in:
@@ -723,6 +723,30 @@ export function createCli(serverHandler?: (port?: number) => Promise<void>): Com
|
||||
}
|
||||
});
|
||||
|
||||
// cw initiative phases <initiative-id>
|
||||
initiativeCommand
|
||||
.command('phases <initiativeId>')
|
||||
.description('List phases for an initiative')
|
||||
.action(async (initiativeId: string) => {
|
||||
try {
|
||||
const client = createDefaultTrpcClient();
|
||||
const phases = await client.listPhases.query({ initiativeId });
|
||||
if (phases.length === 0) {
|
||||
console.log('No phases found');
|
||||
return;
|
||||
}
|
||||
for (const phase of phases) {
|
||||
console.log(`${phase.number.toString().padStart(2)}. ${phase.name} [${phase.status}]`);
|
||||
if (phase.description) {
|
||||
console.log(` ${phase.description}`);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to list phases:', (error as Error).message);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
// Architect command group
|
||||
const architectCommand = program
|
||||
.command('architect')
|
||||
|
||||
Reference in New Issue
Block a user