@kubb/cli
Version:
Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.
49 lines (47 loc) • 1.27 kB
JavaScript
import { defineCommand, showUsage } from 'citty';
import consola from 'consola';
import { colors } from 'consola/utils';
import { createJiti } from 'jiti';
// src/commands/mcp.ts
var jiti = createJiti(import.meta.url, {
sourceMaps: true
});
var args = {
help: {
type: "boolean",
description: "Show help",
alias: "h",
default: false
}
};
var command = defineCommand({
meta: {
name: "mcp",
description: "Start the server to enable the MCP client to interact with the LLM."
},
args,
async run(commandContext) {
const { args: args2 } = commandContext;
if (args2.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(colors.yellow("This feature is still under development \u2014 use with caution"));
await startServer();
} catch (e) {
consola.error(e?.message);
}
}
});
var mcp_default = command;
export { mcp_default as default };
//# sourceMappingURL=mcp-LTBICXYR.js.map
//# sourceMappingURL=mcp-LTBICXYR.js.map