- CoordinationServer class using node:http - GET /health returns status, uptime, processCount - GET /status returns full server state and process list - PID file at ~/.cw/server.pid prevents duplicate servers - CLI --server flag and --port option for server mode - CW_PORT env var support for custom port
28 lines
622 B
JavaScript
28 lines
622 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Codewalk District CLI Entry Point
|
|
*
|
|
* Users can install globally via:
|
|
* - npm link (during development)
|
|
* - npm i -g codewalk-district (for release)
|
|
*/
|
|
|
|
import { runCli } from '../cli/index.js';
|
|
|
|
// Handle uncaught errors gracefully
|
|
process.on('uncaughtException', (error) => {
|
|
console.error('Fatal error:', error.message);
|
|
process.exit(1);
|
|
});
|
|
|
|
process.on('unhandledRejection', (reason) => {
|
|
console.error('Unhandled promise rejection:', reason);
|
|
process.exit(1);
|
|
});
|
|
|
|
// Run the CLI
|
|
runCli().catch((error) => {
|
|
console.error('CLI error:', error.message);
|
|
process.exit(1);
|
|
});
|