/** * Commands Command * * Serializes the CLI command registry (`COMMANDS`) as JSON so an external * consumer — `@celilo/mcp` above all — can fetch the *live* surface of whatever * celilo version this server runs and generate its tool set from it, rather than * compiling a copy that drifts (design D3). The registry is already structured * data; this just prints it. */ import { COMMANDS } from '@celilo/core'; import type { CommandResult } from '../types'; /** * Handle `celilo commands [--json]`. * * The only useful output is the JSON tree, so we emit it whether or not `--json` * is passed; the flag exists to make the intent explicit and completable. */ export async function handleCommands( _args: string[], _flags: Record = {}, ): Promise { return { success: true, message: JSON.stringify(COMMANDS), rawOutput: true, }; }