UNPKG

cntx-ui

Version:

Minimal file bundling and tagging tool for AI development

52 lines (41 loc) • 1.15 kB
#!/usr/bin/env node import { startServer, generateBundle, initConfig, getStatus } from '../server.js'; const args = process.argv.slice(2); const command = args[0] || 'watch'; // Graceful shutdown process.on('SIGINT', () => { console.log('\nšŸ‘‹ Shutting down cntx-ui...'); process.exit(0); }); switch (command) { case 'watch': const port = parseInt(args[1]) || 3333; startServer({ port }); break; case 'bundle': const bundleName = args[1] || 'master'; try { generateBundle(bundleName); console.log(`āœ… Bundle '${bundleName}' generated`); } catch (e) { console.error(`āŒ Bundle '${bundleName}' not found`); } break; case 'init': initConfig(); break; case 'status': getStatus(); break; default: console.log(`cntx-ui v2.0.0 Usage: cntx-ui init Initialize configuration cntx-ui watch [port] Start API server (default port: 3333) cntx-ui bundle [name] Generate specific bundle (default: master) cntx-ui status Show current status Examples: cntx-ui init cntx-ui watch 8080 cntx-ui bundle api`); }