UNPKG

polymath-arch

Version:

Polymath Universata - Autonomous Software Architect & Curator Platform with multi-agent orchestration, advanced code analysis, intelligent development workflows, and AST-based pattern recognition

75 lines (65 loc) 2.2 kB
#!/usr/bin/env node const COMMANDS = { init: 'Initialize assistant in current directory', mcp: 'MCP server diagnostics', analyze: 'Analyze project architecture', develop: 'Start development session', agent: 'Manage specialized agents', docs: 'Generate documentation', render: 'Render documentation site', bundle: 'Bundle project using esbuild', consent: 'Manage consent', audit: 'Query audit logs', help: 'Show help', }; function printHelp() { console.log('Autonomous Software Architect + Developer\n'); console.log('USAGE: polymath <command> [options]\n'); console.log('COMMANDS:'); for (const [cmd, desc] of Object.entries(COMMANDS)) { console.log(` ${cmd.padEnd(12)} ${desc}`); } } async function main() { const args = process.argv.slice(2); if (args.length === 0 || args[0] === 'help') { printHelp(); return; } const cmd = args[0]; switch (cmd) { case 'bundle': { console.log('Bundling project...'); try { const { spawn } = await import('child_process'); // Use the separate bundle script to avoid bundling issues const bundleProcess = spawn('node', ['bundle.js'], { stdio: 'inherit', shell: true }); await new Promise((resolve, reject) => { bundleProcess.on('close', (code) => { if (code === 0) { resolve(void 0); } else { reject(new Error(`Bundle script exited with code ${code}`)); } }); bundleProcess.on('error', reject); }); } catch (error) { console.error('❌ Bundling failed:', error instanceof Error ? error.message : String(error)); console.log('💡 Make sure the bundle.js script is available'); process.exit(1); } break; } default: console.error(`Unknown command: ${cmd}`); console.log('Note: Only the bundle command is available in this minimal CLI.'); console.log('For other commands, use the full CLI from src/cli.ts'); printHelp(); process.exit(1); } } main().catch(console.error);