#!/usr/bin/env node import { Command } from 'commander'; const program = new Command(); program.name('mosaic').description('Mosaic Stack CLI').version('0.0.0'); program .command('tui') .description('Launch interactive TUI connected to the gateway') .option('-g, --gateway ', 'Gateway URL', 'http://localhost:4000') .option('-c, --conversation ', 'Resume a conversation by ID') .action(async (opts: { gateway: string; conversation?: string }) => { // Dynamic import to avoid loading React/Ink for other commands const { render } = await import('ink'); const React = await import('react'); const { TuiApp } = await import('./tui/app.js'); render( React.createElement(TuiApp, { gatewayUrl: opts.gateway, conversationId: opts.conversation, }), ); }); program.parse();