@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.17 kB
JavaScript
import { t as __name } from "./chunk-DKWOrOAv.js";
import { defineCommand, showUsage } from "citty";
import { styleText } from "node:util";
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) {
console.error(`Import of '@kubb/mcp' is required to start the MCP server`);
process.exit(1);
}
const { run } = mod;
try {
console.log("⏳ Starting MCP server...");
console.warn(styleText("yellow", "This feature is still under development — use with caution"));
await run();
} catch (error) {
console.error(error?.message);
}
}
});
//#endregion
export { command as default };
//# sourceMappingURL=mcp-Jboea6xH.js.map