Files
boocode/packages/ion/src/cli/commands/list.ts
indifferentketchup 02063072ab chore: add ion package, codesight wiki, work plans, ascli config
New @boocode/ion package (v0.0.1) for inference optimization network.
.codesight/ wiki artifacts for codebase documentation.
.omo/ work plans for openspec cleanup and enhanced file panel.
2026-06-07 22:16:45 +00:00

59 lines
1.6 KiB
TypeScript

/**
* `workflow list` — List all available workflows.
*
* Discovers workflows from both bundled and project sources and displays
* them in a formatted table (or JSON with --json).
*
* @example
* workflow list
* workflow list --json
*/
import type { CliOptions } from '../utils.js';
import { printTable, printJson } from '../utils.js';
// ---------------------------------------------------------------------------
// Stub: engine integration (not implemented yet)
// ---------------------------------------------------------------------------
interface WorkflowEntry {
name: string;
description: string;
source: 'bundled' | 'project';
}
async function discoverWorkflows(_cwd?: string): Promise<WorkflowEntry[]> {
throw new Error('not implemented yet: discoverWorkflows');
}
// ---------------------------------------------------------------------------
// Command handler
// ---------------------------------------------------------------------------
export async function listCommand(
_args: string[],
options: CliOptions,
): Promise<void> {
const workflows = await discoverWorkflows(options.cwd);
if (options.json) {
printJson(workflows);
return;
}
console.log('Available workflows:');
console.log('');
printTable(
workflows.map((w) => ({
name: w.name,
description: w.description,
source: w.source,
})),
[
{ header: 'Name', field: 'name', minWidth: 20 },
{ header: 'Description', field: 'description', minWidth: 30 },
{ header: 'Source', field: 'source', minWidth: 10 },
],
);
}