2b38e583be
Each commands/ subfolder (cas, init, thread, workflow) now has: - types.ts for all type definitions - index.ts with pure re-exports only - External imports go through index.ts Closes #108
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import type { CommandGroup } from "./cli-command-types.js";
|
|
import { setCommandGroupsForUsage } from "./cli-usage-context.js";
|
|
import { CAS_SUBCOMMAND_TABLE } from "./commands/cas/index.js";
|
|
import { INIT_SUBCOMMAND_TABLE } from "./commands/init/index.js";
|
|
import { THREAD_SUBCOMMAND_TABLE } from "./commands/thread/index.js";
|
|
import { WORKFLOW_SUBCOMMAND_TABLE } from "./commands/workflow/index.js";
|
|
|
|
export function getCommandRegistry(): ReadonlyArray<CommandGroup> {
|
|
return [
|
|
{
|
|
name: "workflow",
|
|
commands: Object.entries(WORKFLOW_SUBCOMMAND_TABLE).map(([name, e]) => ({
|
|
name,
|
|
args: e.args,
|
|
description: e.description,
|
|
})),
|
|
},
|
|
{
|
|
name: "thread",
|
|
commands: Object.entries(THREAD_SUBCOMMAND_TABLE).map(([name, e]) => ({
|
|
name,
|
|
args: e.args,
|
|
description: e.description,
|
|
})),
|
|
},
|
|
{
|
|
name: "cas",
|
|
commands: Object.entries(CAS_SUBCOMMAND_TABLE).map(([name, e]) => ({
|
|
name,
|
|
args: e.args,
|
|
description: e.description,
|
|
})),
|
|
},
|
|
{
|
|
name: "init",
|
|
commands: Object.entries(INIT_SUBCOMMAND_TABLE).map(([name, e]) => ({
|
|
name,
|
|
args: e.args,
|
|
description: e.description,
|
|
})),
|
|
},
|
|
];
|
|
}
|
|
|
|
setCommandGroupsForUsage(getCommandRegistry());
|