Files
Codewalkers/src/bin/cw.ts
Lukas May bec46aa234 feat(01-05): add HTTP server with health endpoint and PID file
- 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
2026-01-30 13:22:35 +01:00

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);
});