import type { Command } from 'commander'; import { fail } from '../error-handler'; import { runCommand } from '../run-command'; export function registerTuiCommand(program: Command): void { program .command('tui') .description('Launch interactive terminal UI') .action(async () => { await runCommand(program, async (_output) => { const opts = program.opts(); if (opts.json) { fail('The TUI cannot run with --json'); } if (!process.stdin.isTTY || !process.stdout.isTTY) { fail('The TUI requires an interactive terminal'); } const { launchTui } = await import('../../tui/index.tsx'); await launchTui(opts.database); }); }); }