UNPKG

@pimzino/claude-code-spec-workflow

Version:

Automated workflows for Claude Code. Includes spec-driven development (Requirements → Design → Tasks → Implementation) with intelligent orchestration, optional steering documents and streamlined bug fix workflow (Report → Analyze → Fix → Verify). We have

116 lines 5.27 kB
#!/usr/bin/env node "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const chalk_1 = __importDefault(require("chalk")); const ora_1 = __importDefault(require("ora")); const server_1 = require("./server"); const multi_server_1 = require("./multi-server"); const fs_1 = require("fs"); const path_1 = require("path"); const program = new commander_1.Command(); program .name('claude-spec-dashboard') .description('Launch a real-time dashboard for Claude Code Spec Workflow') .version('1.3.0'); program .option('-p, --port <port>', 'Port to run the dashboard on', '3000') .option('-d, --dir <path>', 'Project directory containing .claude', process.cwd()) .option('-o, --open', 'Open dashboard in browser automatically') .option('-m, --multi', 'Launch multi-project dashboard') .action(async (options) => { if (options.multi) { console.log(chalk_1.default.cyan.bold('🚀 Claude Code Multi-Project Dashboard')); console.log(chalk_1.default.gray('Monitoring all Claude projects on your system')); console.log(); const spinner = (0, ora_1.default)('Discovering Claude projects...').start(); try { const server = new multi_server_1.MultiProjectDashboardServer({ port: parseInt(options.port), autoOpen: options.open, }); await server.start(); spinner.succeed(chalk_1.default.green(`Multi-project dashboard running at http://localhost:${options.port}`)); console.log(); console.log(chalk_1.default.gray('Press Ctrl+C to stop the server')); console.log(); // Handle graceful shutdown process.on('SIGINT', async () => { console.log(chalk_1.default.yellow('\n\nShutting down dashboard...')); const forceExitTimeout = setTimeout(() => { console.log(chalk_1.default.red('Force exiting...')); process.exit(1); }, 5000); try { await server.stop(); clearTimeout(forceExitTimeout); process.exit(0); } catch (error) { console.error(chalk_1.default.red('Error during shutdown:'), error); process.exit(1); } }); } catch (error) { spinner.fail('Failed to start multi-project dashboard'); console.error(chalk_1.default.red('Error:'), error instanceof Error ? error.message : error); process.exit(1); } } else { console.log(chalk_1.default.cyan.bold('🚀 Claude Code Spec Dashboard')); console.log(chalk_1.default.gray('Real-time spec and task monitoring')); console.log(); const projectPath = options.dir; const claudePath = (0, path_1.join)(projectPath, '.claude'); // Check if .claude directory exists if (!(0, fs_1.existsSync)(claudePath)) { console.error(chalk_1.default.red('❌ Error: .claude directory not found')); console.log(chalk_1.default.yellow('Make sure you are in a project with Claude Code Spec Workflow installed')); console.log(chalk_1.default.gray('Run: npx @pimzino/claude-code-spec-workflow@latest')); process.exit(1); } const spinner = (0, ora_1.default)('Starting dashboard server...').start(); try { const server = new server_1.DashboardServer({ port: parseInt(options.port), projectPath, autoOpen: options.open, }); await server.start(); spinner.succeed(chalk_1.default.green(`Dashboard running at http://localhost:${options.port}`)); console.log(); console.log(chalk_1.default.gray('Press Ctrl+C to stop the server')); console.log(); // Handle graceful shutdown process.on('SIGINT', async () => { console.log(chalk_1.default.yellow('\n\nShutting down dashboard...')); // Set a timeout to force exit if graceful shutdown hangs const forceExitTimeout = setTimeout(() => { console.log(chalk_1.default.red('Force exiting...')); process.exit(1); }, 5000); // 5 second timeout try { await server.stop(); clearTimeout(forceExitTimeout); process.exit(0); } catch (error) { console.error(chalk_1.default.red('Error during shutdown:'), error); process.exit(1); } }); } catch (error) { spinner.fail('Failed to start dashboard'); console.error(chalk_1.default.red('Error:'), error instanceof Error ? error.message : error); process.exit(1); } } }); program.parse(); //# sourceMappingURL=cli.js.map