@kubb/cli
Version:
Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.
1 lines • 1.89 kB
Source Map (JSON)
{"version":3,"file":"mcp-97TXkJVX.cjs","names":["jiti"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport type { ArgsDef } from 'citty'\nimport { defineCommand, showUsage } from 'citty'\nimport { createJiti } from 'jiti'\n\nconst jiti = createJiti(import.meta.url, {\n sourceMaps: true,\n})\n\nconst args = {\n help: {\n type: 'boolean',\n description: 'Show help',\n alias: 'h',\n default: false,\n },\n} as const satisfies ArgsDef\n\nconst command = defineCommand({\n meta: {\n name: 'mcp',\n description: 'Start the server to enable the MCP client to interact with the LLM.',\n },\n args,\n async run(commandContext) {\n const { args } = commandContext\n\n if (args.help) {\n return showUsage(command)\n }\n\n let mod: any\n try {\n mod = await jiti.import('@kubb/mcp', { default: true })\n } catch (_e) {\n console.error(`Import of '@kubb/mcp' is required to start the MCP server`)\n process.exit(1)\n }\n\n const { run } = mod\n try {\n console.log('⏳ Starting MCP server...')\n console.warn(styleText('yellow', 'This feature is still under development — use with caution'))\n await run()\n } catch (error) {\n console.error((error as Error)?.message)\n }\n },\n})\n\nexport default command\n"],"mappings":";;;;;;AAKA,MAAMA,6EAAmC,EACvC,YAAY,MACb,CAAC;AAWF,MAAM,mCAAwB;CAC5B,MAAM;EACJ,MAAM;EACN,aAAa;EACd;CACD,MAdW,EACX,MAAM;EACJ,MAAM;EACN,aAAa;EACb,OAAO;EACP,SAAS;EACV,EACF;CAQC,MAAM,IAAI,gBAAgB;EACxB,MAAM,EAAE,SAAS;AAEjB,MAAI,KAAK,KACP,6BAAiB,QAAQ;EAG3B,IAAI;AACJ,MAAI;AACF,SAAM,MAAMA,OAAK,OAAO,aAAa,EAAE,SAAS,MAAM,CAAC;WAChD,IAAI;AACX,WAAQ,MAAM,4DAA4D;AAC1E,WAAQ,KAAK,EAAE;;EAGjB,MAAM,EAAE,QAAQ;AAChB,MAAI;AACF,WAAQ,IAAI,2BAA2B;AACvC,WAAQ,8BAAe,UAAU,6DAA6D,CAAC;AAC/F,SAAM,KAAK;WACJ,OAAO;AACd,WAAQ,MAAO,OAAiB,QAAQ;;;CAG7C,CAAC"}