UNPKG

vibehub-cli

Version:

VibeHub CLI - Command line interface for VibeHub

79 lines • 4.25 kB
import { Command } from 'commander'; import chalk from 'chalk'; import { VibeHubManager } from '../lib/vibehub-manager.js'; export const statusCommand = new Command('status') .description('Show the status of the VibeHub repository') .option('-v, --verbose', 'Show detailed information') .action(async (options) => { const cwd = process.cwd(); const vibehubManager = new VibeHubManager(cwd); try { const status = await vibehubManager.getStatus(); if (!status.initialized) { console.log(chalk.red('āŒ Not a VibeHub repository')); console.log(chalk.blue('Run ') + chalk.cyan('vibe init') + chalk.blue(' to initialize a new repository')); return; } const config = status.config; console.log(chalk.blue('šŸ“Š VibeHub Repository Status\n')); // Basic info console.log(chalk.white('Project: ') + chalk.cyan(config.projectName)); if (config.description) { console.log(chalk.white('Description: ') + chalk.gray(config.description)); } console.log(chalk.white('Author: ') + chalk.gray(config.author?.name || 'Unknown')); console.log(chalk.white('Email: ') + chalk.gray(config.author?.email || 'Not set')); console.log(chalk.white('Created: ') + chalk.gray(new Date(config.createdAt).toLocaleDateString())); console.log(chalk.white('Version: ') + chalk.gray(config.version)); // Stats console.log(chalk.white('\nšŸ“ˆ Statistics:')); console.log(chalk.white(' Sessions: ') + chalk.cyan(status.sessionCount)); console.log(chalk.white(' Commits: ') + chalk.cyan(status.commitCount)); if (status.lastActivity) { console.log(chalk.white(' Last Activity: ') + chalk.gray(new Date(status.lastActivity).toLocaleString())); } // Auto-sync status console.log(chalk.white('\nšŸ”„ Auto-sync: ') + (config.config?.autoSync ? chalk.green('Enabled') : chalk.yellow('Disabled'))); // Cloud connection status if (config.cloud) { console.log(chalk.white('\nā˜ļø Cloud Connection: ') + chalk.green('Connected')); console.log(chalk.white(' Project URL: ') + chalk.cyan(config.cloud.projectUrl)); console.log(chalk.white(' API URL: ') + chalk.cyan(config.cloud.apiUrl)); console.log(chalk.white(' User Email: ') + chalk.cyan(config.cloud.userEmail || 'Not set')); // Check authentication status if (config.author?.email && config.cloud.userEmail) { if (config.author.email === config.cloud.userEmail) { console.log(chalk.white(' Authentication: ') + chalk.green('āœ… Verified')); } else { console.log(chalk.white(' Authentication: ') + chalk.red('āŒ Failed')); console.log(chalk.white(' Local: ') + chalk.gray(config.author.email)); console.log(chalk.white(' Cloud: ') + chalk.gray(config.cloud.userEmail)); } } else { console.log(chalk.white(' Authentication: ') + chalk.yellow('āš ļø Not configured')); } if (config.lastSync) { console.log(chalk.white(' Last Sync: ') + chalk.gray(new Date(config.lastSync).toLocaleString())); } } else { console.log(chalk.white('\nā˜ļø Cloud Connection: ') + chalk.yellow('Not Connected')); console.log(chalk.blue(' Run ') + chalk.cyan('vibe set <project-url>') + chalk.blue(' to connect to a cloud project')); } if (options.verbose) { console.log(chalk.white('\nšŸ“ Repository Structure:')); console.log(chalk.gray(' .vibehub/')); console.log(chalk.gray(' ā”œā”€ā”€ vibehub.json')); console.log(chalk.gray(' ā”œā”€ā”€ sessions/')); console.log(chalk.gray(' ā”œā”€ā”€ commits/')); console.log(chalk.gray(' └── workspace/')); } } catch (error) { console.error(chalk.red('Failed to get repository status:'), error); process.exit(1); } }); //# sourceMappingURL=status.js.map