UNPKG

@botpress/adk-cli

Version:

Command-line interface for the Botpress Agent Development Kit (ADK)

63 lines (61 loc) 1.89 kB
// @bun import { ensureUiServer } from "./chunk-sgj6770p.js"; import { createCliLogger } from "./chunk-gzwt1qdr.js"; import"./chunk-nxy2ya5r.js"; import"./chunk-wzj4dc7n.js"; import"./chunk-p0hjqn4r.js"; import"./chunk-np5wcwfv.js"; import"./chunk-dq2xpa24.js"; import"./chunk-6w0knnta.js"; import"./chunk-40x04ckt.js"; import"./chunk-t76d8fxx.js"; import"./chunk-nh2akp42.js"; import"./chunk-0fdvzjbh.js"; import"./chunk-2a5b6azq.js"; import"./chunk-vay209b5.js"; import"./chunk-3xrpxgq4.js"; import"./chunk-rfm3jr1m.js"; import"./chunk-w346ejn9.js"; import"./chunk-knvm2anf.js"; import"./chunk-65h5trb5.js"; import"./chunk-s2akeqpw.js"; import"./chunk-6771vrjp.js"; import"./chunk-g8mm42v1.js"; import"./chunk-50hzjdck.js"; import"./chunk-nn2jb0x0.js"; import"./chunk-v8xvth6j.js"; import"./chunk-kkk13rcb.js"; import"./chunk-ytpp1kam.js"; import"./chunk-na956zz3.js"; import"./chunk-f4bw8q7c.js"; import"./chunk-0v8vgrns.js"; import"./chunk-54qt5g7m.js"; import"./chunk-dhs2bg35.js"; // src/commands/adk-dashboard.ts import { exec } from "child_process"; async function adkDashboard(options = {}) { const logger = createCliLogger({ format: options.format }); const startPort = options.portConsole ? parseInt(options.portConsole, 10) : undefined; const { port, wasSpawned } = await ensureUiServer({ startPort, standalone: true }); const url = `http://localhost:${port}`; const result = { port, url, wasSpawned }; logger.info(wasSpawned ? `DevConsole started at ${url}` : `DevConsole already running at ${url}`).result(result); if (options.openBrowser !== false) { const openCmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open"; exec(`${openCmd} ${url}`, (err) => { if (err) logger.error(`Failed to open browser: ${err.message}`); }); } return result; } export { adkDashboard };