UNPKG

@kubb/cli

Version:

Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.

42 lines (40 loc) 1.15 kB
import { defineCommand, showUsage } from "citty"; import consola from "consola"; import pc from "picocolors"; import { createJiti } from "jiti"; //#region src/commands/mcp.ts const jiti = createJiti(import.meta.url, { sourceMaps: true }); const command = defineCommand({ meta: { name: "mcp", description: "Start the server to enable the MCP client to interact with the LLM." }, args: { help: { type: "boolean", description: "Show help", alias: "h", default: false } }, async run(commandContext) { const { args } = commandContext; if (args.help) return showUsage(command); let mod; try { mod = await jiti.import("@kubb/mcp", { default: true }); } catch (_e) { consola.error(`Import of '@kubb/mcp' is required to start the MCP server`); } const { startServer } = mod; try { consola.start("Starting MCP server..."); consola.warn(pc.yellow("This feature is still under development — use with caution")); await startServer(); } catch (e) { consola.error(e?.message); } } }); var mcp_default = command; //#endregion export { mcp_default as default }; //# sourceMappingURL=mcp-C4KjGtQv.js.map