Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
29 lines
843 B
JavaScript
29 lines
843 B
JavaScript
#!/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 <url>', 'Gateway URL', 'http://localhost:4000')
|
|
.option('-c, --conversation <id>', '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();
|