import { formatExamples, register } from "../registry.js";
import { Command } from "commander";
//#region src/cli/commands/tui.ts
function createTuiCommand(_ctx) {
	return new Command("tui").description("Interactive terminal UI (pi-tui)").addHelpText("after", formatExamples([
		"xopc tui                                    # Connect to local gateway (default)",
		"xopc tui --local                            # Embedded mode, no gateway needed",
		"xopc tui --url http://host:3120 --token xxx # Connect to remote gateway",
		"xopc tui -s telegram:dm:123456              # Resume a session",
		"xopc tui -m \"Summarize my inbox\"            # Send a message on launch"
	])).option("--url <url>", "Gateway URL (default: http://localhost:3120)").option("--token <token>", "Gateway bearer token").option("-s, --session <key>", "Session key to resume").option("-m, --message <text>", "Send a message on launch").option("--local", "Run in embedded mode (no gateway required)").option("--theme <name>", "Theme: auto, dark, light, or custom name from ~/.xopc/themes/").option("--thinking <level>", "Thinking level override").action(async (options) => {
		const { runTui } = await import("../../tui/tui.js");
		await runTui({
			url: typeof options.url === "string" ? options.url : void 0,
			token: typeof options.token === "string" ? options.token : void 0,
			session: typeof options.session === "string" ? options.session : void 0,
			message: typeof options.message === "string" ? options.message : void 0,
			local: options.local === true,
			thinking: typeof options.thinking === "string" ? options.thinking : void 0,
			theme: typeof options.theme === "string" ? options.theme : void 0
		});
	});
}
register({
	id: "tui",
	name: "tui",
	description: "Interactive terminal UI (pi-tui)",
	factory: createTuiCommand,
	metadata: {
		category: "runtime",
		examples: [
			"xopc tui",
			"xopc tui --local",
			"xopc tui --url http://host:3120"
		]
	}
});
//#endregion
export {};

//# sourceMappingURL=tui.js.map