UNPKG

hey-claudio

Version:

šŸ¤– HeyClaudio: AI-powered development assistant with R.A.D.A.R. analysis + C.I.D.E.R. atomic issues for Claude IDE

254 lines (219 loc) • 9.71 kB
#!/usr/bin/env node const { Command } = require('commander'); const chalk = require('chalk'); const { execSync } = require('child_process'); const fs = require('fs'); const path = require('path'); const program = new Command(); // ASCII Art para HeyClaudio function showWelcome() { console.log(chalk.cyan(` ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•”ā•ā•ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā–ˆā–ˆā•— ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā• ā•šā•ā•ā•ā•ā•ā•ā•šā•ā•ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā• ā•šā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā• ā•šā•ā•ā•ā•ā•ā• `)); console.log(chalk.gray(' šŸ¤– AI-Powered Development Assistant\n')); } function checkClaude() { try { execSync('claude --version', { stdio: 'pipe' }); return true; } catch { return false; } } function isProjectSetup() { return fs.existsSync('./.claude') && fs.existsSync('./.claude/commands') && fs.existsSync('./.claude/current/project-state.md'); } function showStatus() { console.log(chalk.blue.bold('šŸ“Š PROJECT STATUS\n')); // Check setup const setupOk = isProjectSetup(); console.log(setupOk ? chalk.green('āœ… Project setup complete') : chalk.red('āŒ Project not setup - run: claudio init') ); // Check Claude IDE const claudeOk = checkClaude(); console.log(claudeOk ? chalk.green('āœ… Claude IDE available') : chalk.yellow('āš ļø Claude IDE not found - install from https://claude.ai/download') ); if (setupOk) { // Show current epic const activeEpicPath = './.claude/current/active-epic.md'; if (fs.existsSync(activeEpicPath)) { const content = fs.readFileSync(activeEpicPath, 'utf8'); const epicMatch = content.match(/# Active Epic: (.+)/); if (epicMatch) { console.log(chalk.cyan(`šŸŽÆ Active Epic: ${epicMatch[1]}`)); } } // Show recent activity const projectStatePath = './.claude/current/project-state.md'; if (fs.existsSync(projectStatePath)) { const content = fs.readFileSync(projectStatePath, 'utf8'); const activityMatch = content.match(/## Recent Activity\n([\s\S]*?)(?=\n##|$)/); if (activityMatch) { console.log(chalk.gray('šŸ“ Recent Activity:')); const activities = activityMatch[1].split('\n').filter(line => line.trim().startsWith('-')).slice(0, 3); activities.forEach(activity => { console.log(chalk.gray(` ${activity.trim()}`)); }); } } } console.log(chalk.blue('\nšŸš€ NEXT STEPS:')); if (!setupOk) { console.log(chalk.white(' 1. claudio init # Setup project')); console.log(chalk.white(' 2. claude # Open Claude IDE')); console.log(chalk.white(' 3. /project:radar:analyze # Run analysis')); } else if (!claudeOk) { console.log(chalk.white(' 1. Install Claude IDE # https://claude.ai/download')); console.log(chalk.white(' 2. claude # Open Claude IDE')); console.log(chalk.white(' 3. /project:radar:analyze # Run analysis')); } else { console.log(chalk.white(' 1. claude # Open Claude IDE')); console.log(chalk.white(' 2. /project:radar:analyze # Run analysis')); console.log(chalk.white(' 3. /project:cider:generate # Create issues')); console.log(chalk.white(' 4. /project:cider:work # Start development')); } } function showCommands() { console.log(chalk.blue.bold('šŸŽÆ AVAILABLE COMMANDS\n')); console.log(chalk.cyan('šŸ“‹ Setup & Status:')); console.log(chalk.white(' claudio init # Initialize project')); console.log(chalk.white(' claudio status # Show project status')); console.log(chalk.white(' claudio check # Check configuration')); console.log(chalk.white(' claudio update # Update templates to latest')); console.log(chalk.cyan('\nšŸ” Quick Actions:')); console.log(chalk.white(' claudio open # Open Claude IDE')); console.log(chalk.white(' claudio analyze # Run quick analysis')); console.log(chalk.cyan('\n⚔ Claude IDE Commands (use inside Claude):')); console.log(chalk.white(' /project:radar:analyze # Complete project analysis')); console.log(chalk.white(' /project:radar:quick # Quick project overview')); console.log(chalk.white(' /project:cider:generate # Generate atomic issues')); console.log(chalk.white(' /project:cider:work # Work on specific issue')); console.log(chalk.white(' /project:cider:status # Project status')); console.log(chalk.white(' /project:cider:list-epics # List available epics')); console.log(chalk.yellow('\nšŸ’” Workflow:')); console.log(chalk.gray(' 1. claudio init # One-time setup')); console.log(chalk.gray(' 2. claude # Open Claude IDE')); console.log(chalk.gray(' 3. /project:radar:analyze # Understand project')); console.log(chalk.gray(' 4. /project:cider:generate # Create work items')); console.log(chalk.gray(' 5. /project:cider:work # Start coding')); } // Commands program .name('claudio') .description('šŸ¤– AI-Powered Development Assistant') .version('1.0.0') .action(() => { showWelcome(); showStatus(); }); program .command('init') .description('šŸš€ Initialize project with HeyClaudio') .action(() => { console.log(chalk.blue.bold('šŸš€ INITIALIZING PROJECT\n')); // Run setup const setupScript = path.join(__dirname, 'claude-setup.js'); try { console.log(chalk.cyan('Setting up project structure...')); execSync(`node "${setupScript}" init`, { stdio: 'inherit' }); console.log(chalk.green.bold('\nšŸŽ‰ PROJECT READY!')); console.log(chalk.cyan('\nšŸš€ What\'s next?')); console.log(chalk.white(' 1. Open Claude IDE: ' + chalk.bold('claude'))); console.log(chalk.white(' 2. Run analysis: ' + chalk.bold('/project:radar:analyze'))); console.log(chalk.white(' 3. Start coding: ' + chalk.bold('/project:cider:generate'))); } catch (error) { console.error(chalk.red('āŒ Setup failed:'), error.message); process.exit(1); } }); program .command('status') .description('šŸ“Š Show project status') .action(showStatus); program .command('check') .description('šŸ” Check configuration') .action(() => { const setupScript = path.join(__dirname, 'claude-setup.js'); try { execSync(`node "${setupScript}" check`, { stdio: 'inherit' }); } catch (error) { console.error(chalk.red('āŒ Check failed:'), error.message); } }); program .command('open') .alias('claude') .description('šŸš€ Open Claude IDE') .action(() => { if (!checkClaude()) { console.log(chalk.red('āŒ Claude IDE not found')); console.log(chalk.yellow('šŸ’” Install from: https://claude.ai/download')); return; } console.log(chalk.cyan('šŸš€ Opening Claude IDE...')); try { execSync('claude', { stdio: 'inherit' }); } catch (error) { console.error(chalk.red('āŒ Failed to open Claude IDE:'), error.message); } }); program .command('update') .description('šŸ”„ Update Claude templates to latest version') .action(() => { const updateScript = path.join(__dirname, 'claude-update.js'); try { execSync(`node "${updateScript}"`, { stdio: 'inherit' }); } catch (error) { console.error(chalk.red('āŒ Update failed:'), error.message); } }); program .command('analyze') .description('šŸ” Guide to run project analysis') .action(() => { if (!isProjectSetup()) { console.log(chalk.red('āŒ Project not setup')); console.log(chalk.yellow('šŸ’” Run: claudio init')); return; } console.log(chalk.cyan('šŸ” Analysis is now integrated into Claude IDE')); console.log(chalk.white('\nšŸ“‹ To analyze your project:')); console.log(chalk.green(' 1. Open Claude Code: ' + chalk.bold('claude'))); console.log(chalk.green(' 2. Run quick analysis: ' + chalk.bold('/project:radar:quick'))); console.log(chalk.green(' 3. Run full analysis: ' + chalk.bold('/project:radar:analyze'))); console.log(chalk.yellow('\nšŸ’” This provides better integration and user experience')); console.log(chalk.gray(' Native slash commands work directly in Claude IDE')); }); program .command('help-commands') .description('šŸ“‹ Show all available commands') .action(showCommands); // Help override program.configureHelp({ afterAll: () => { return ` ${chalk.cyan('šŸŽÆ Quick Start:')} ${chalk.white('claudio init')} # Initialize project ${chalk.white('claude')} # Open Claude IDE ${chalk.white('/project:radar:analyze')} # Run analysis ${chalk.cyan('šŸ’” Need help?')} ${chalk.white('claudio help-commands')} # Show all commands ${chalk.white('claudio status')} # Check project status ${chalk.gray('šŸš€ Built for AI-powered development')} `; } }); program.parse();