@aerocorp/cli
Version:
AeroCorp CLI 5.1.0 - Future-Proofed Enterprise Infrastructure with Live Preview, Tunneling & Advanced DevOps
847 lines โข 30.4 kB
JavaScript
#!/usr/bin/env node
"use strict";
/**
* AeroCorp CLI 3.0.0 - Future-Proofed for 2030
* Advanced deployment automation with AI, GitOps, Edge Computing & Quantum Security
*
* Features:
* - ๐ค AI-Powered Deployment Optimization
* - ๐ฎ GitOps & Infrastructure as Code
* - ๐ Edge Computing & Multi-Region Deployments
* - ๐ Quantum-Ready Security & Zero-Trust Architecture
* - โธ๏ธ Kubernetes Native Support
* - ๐ Serverless & Function-as-a-Service
* - ๐ Advanced Observability & Monitoring
* - ๐ Automated Rollbacks & Canary Deployments
* - ๐ Multi-Cloud & Hybrid Infrastructure
* - ๐ก๏ธ Advanced Security Scanning & Compliance
*/
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 boxen_1 = __importDefault(require("boxen"));
const auth_1 = require("./services/auth");
const config_1 = require("./services/config");
const deploy_1 = require("./services/deploy");
const project_1 = require("./services/project");
const log_1 = require("./services/log");
const health_1 = require("./services/health");
const ai_optimizer_1 = require("./services/ai-optimizer");
const gitops_manager_1 = require("./services/gitops-manager");
const edge_manager_1 = require("./services/edge-manager");
const monitoring_1 = require("./services/monitoring");
const database_1 = require("./services/database");
const security_1 = require("./services/security");
const deployment_1 = require("./services/deployment");
const coolify_1 = require("./services/coolify");
const wsl_1 = require("./services/wsl");
const preview_1 = require("./services/preview");
const windows_native_1 = require("./services/windows-native");
const ssh_native_1 = require("./services/ssh-native");
const vercel_like_deploy_1 = require("./services/vercel-like-deploy");
const program = new commander_1.Command();
const authService = new auth_1.AuthService();
const configService = new config_1.ConfigService();
const deployService = new deploy_1.DeployService();
const projectService = new project_1.ProjectService();
const logService = new log_1.LogService();
const healthService = new health_1.HealthService();
const aiOptimizer = new ai_optimizer_1.AIOptimizer();
const gitOpsManager = new gitops_manager_1.GitOpsManager();
const edgeManager = new edge_manager_1.EdgeManager();
const monitoringService = new monitoring_1.MonitoringService();
const databaseService = new database_1.DatabaseService();
const securityService = new security_1.SecurityService();
const deploymentService = new deployment_1.DeploymentService();
const coolifyService = new coolify_1.CoolifyService();
const wslService = new wsl_1.WSLService();
const previewService = new preview_1.PreviewService();
const windowsService = new windows_native_1.WindowsNativeService();
const sshService = new ssh_native_1.NativeSSHService();
const vercelLikeService = new vercel_like_deploy_1.VercelLikeDeployService();
// ๐ Advanced CLI Header for 2030
const header = (0, boxen_1.default)(chalk_1.default.cyan.bold('AeroCorp CLI v4.0.0 - Enterprise Hybrid Infrastructure') + '\n' +
chalk_1.default.white('Next-Generation AI-Powered Deployment Platform') + '\n\n' +
chalk_1.default.green('๐ค AI Optimization ๐ฎ GitOps Integration โธ๏ธ Kubernetes Native') + '\n' +
chalk_1.default.green('๐ Edge Computing ๐ Quantum Security ๐ Real-time Monitoring') + '\n' +
chalk_1.default.blue('๐ Serverless Ready ๐ก๏ธ Zero-Trust Arch ๐ Multi-Cloud Support'), {
padding: 1,
margin: 1,
borderStyle: 'double',
borderColor: 'cyan'
});
program
.name('aerocorp')
.description('AeroCorp CLI 4.0.0 - Enterprise Hybrid Infrastructure Management with Advanced Monitoring & Security')
.version('4.0.0')
.hook('preAction', () => {
console.log(header);
});
// Login Command
program
.command('login')
.description('Authenticate with Coolify')
.option('--url <url>', 'Coolify instance URL')
.option('--token <token>', 'API token')
.action(async (options) => {
try {
await authService.login(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Login failed:'), error.message);
process.exit(1);
}
});
// Config Command
program
.command('config')
.description('Manage CLI configuration')
.option('--set <key=value>', 'Set configuration value')
.option('--get <key>', 'Get configuration value')
.option('--list', 'List all configuration')
.option('--reset', 'Reset configuration')
.action(async (options) => {
try {
await configService.handleConfig(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Config failed:'), error.message);
process.exit(1);
}
});
// Deploy Command
program
.command('deploy')
.alias('d')
.description('Deploy your application to AeroCorp platform')
.option('--prod', 'Deploy to production environment')
.option('--staging', 'Deploy to staging environment')
.option('--preview', 'Deploy as preview deployment')
.option('--force', 'Force deployment without cache')
.option('--build-env <env>', 'Set build environment variables')
.option('--env <env>', 'Set runtime environment variables')
.option('--name <name>', 'Override application name')
.option('--region <regions>', 'Deploy to specific regions')
.option('--scale <replicas>', 'Number of replicas to deploy')
.action(async (options) => {
try {
await deployService.deploy(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Deployment failed:'), error.message);
process.exit(1);
}
});
// List Command
program
.command('list')
.alias('ls')
.description('List applications')
.option('--format <format>', 'Output format (table, json)', 'table')
.action(async (options) => {
try {
await projectService.list(options);
}
catch (error) {
console.error(chalk_1.default.red('โ List failed:'), error.message);
process.exit(1);
}
});
// Logs Command
program
.command('logs <app>')
.description('View application logs')
.option('--follow', 'Follow log output')
.option('--tail <lines>', 'Number of lines to show', '100')
.action(async (app, options) => {
try {
await logService.getLogs(app, options);
}
catch (error) {
console.error(chalk_1.default.red('โ Logs failed:'), error.message);
process.exit(1);
}
});
// Health Command
program
.command('health')
.description('Check system health')
.action(async () => {
try {
await healthService.checkHealth();
}
catch (error) {
console.error(chalk_1.default.red('โ Health check failed:'), error.message);
process.exit(1);
}
});
// Status Command
program
.command('status')
.description('Show system status')
.action(async () => {
try {
await healthService.showStatus();
}
catch (error) {
console.error(chalk_1.default.red('โ Status failed:'), error.message);
process.exit(1);
}
});
// ๐ Monitoring Commands
program
.command('monitor')
.description('Real-time system monitoring')
.option('--interval <seconds>', 'Refresh interval in seconds', '5')
.action(async (options) => {
try {
const interval = parseInt(options.interval) * 1000;
await monitoringService.startRealTimeMonitoring(interval);
}
catch (error) {
console.error(chalk_1.default.red('โ Monitoring failed:'), error.message);
process.exit(1);
}
});
program
.command('metrics')
.description('Get system metrics')
.action(async () => {
try {
const metrics = await monitoringService.getMetrics();
monitoringService.displayMetrics(metrics);
}
catch (error) {
console.error(chalk_1.default.red('โ Metrics failed:'), error.message);
process.exit(1);
}
});
program
.command('alerts')
.description('Manage system alerts')
.option('--acknowledged', 'Show only acknowledged alerts')
.option('--severity <level>', 'Filter by severity (low|medium|high|critical)')
.option('--ack <id>', 'Acknowledge alert by ID')
.action(async (options) => {
try {
if (options.ack) {
await monitoringService.acknowledgeAlert(parseInt(options.ack));
}
else {
const alerts = await monitoringService.getAlerts({
acknowledged: options.acknowledged,
severity: options.severity
});
monitoringService.displayAlerts(alerts);
}
}
catch (error) {
console.error(chalk_1.default.red('โ Alerts failed:'), error.message);
process.exit(1);
}
});
program
.command('uptime')
.description('Show system uptime statistics')
.action(async () => {
try {
const uptime = await monitoringService.getUptime();
monitoringService.displayUptime(uptime);
}
catch (error) {
console.error(chalk_1.default.red('โ Uptime failed:'), error.message);
process.exit(1);
}
});
// ๐พ Database Commands
program
.command('db:list')
.description('List database instances')
.option('--platform <platform>', 'Filter by platform (coolify|caprover)')
.option('--type <type>', 'Filter by type (postgresql|mysql|mongodb|redis)')
.option('--status <status>', 'Filter by status (running|stopped|maintenance)')
.action(async (options) => {
try {
await databaseService.listDatabases(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Database list failed:'), error.message);
process.exit(1);
}
});
program
.command('db:create')
.description('Create new database instance')
.option('--name <name>', 'Database name')
.option('--type <type>', 'Database type (postgresql|mysql|mongodb|redis)')
.option('--platform <platform>', 'Platform (coolify|caprover)')
.option('--version <version>', 'Database version')
.option('--size <size>', 'Initial storage size')
.option('--no-interactive', 'Skip interactive prompts')
.action(async (options) => {
try {
await databaseService.createDatabase(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Database creation failed:'), error.message);
process.exit(1);
}
});
program
.command('db:backup <database-id>')
.description('Create database backup')
.option('--type <type>', 'Backup type (manual|automatic)', 'manual')
.action(async (databaseId, options) => {
try {
await databaseService.backupDatabase(databaseId, options);
}
catch (error) {
console.error(chalk_1.default.red('โ Database backup failed:'), error.message);
process.exit(1);
}
});
program
.command('db:restore <database-id> <backup-id>')
.description('Restore database from backup')
.action(async (databaseId, backupId) => {
try {
await databaseService.restoreDatabase(databaseId, backupId);
}
catch (error) {
console.error(chalk_1.default.red('โ Database restore failed:'), error.message);
process.exit(1);
}
});
program
.command('db:backups [database-id]')
.description('List database backups')
.action(async (databaseId) => {
try {
await databaseService.listBackups(databaseId);
}
catch (error) {
console.error(chalk_1.default.red('โ Backup list failed:'), error.message);
process.exit(1);
}
});
program
.command('db:delete <database-id>')
.description('Delete database instance')
.option('--force', 'Skip confirmation prompt')
.action(async (databaseId, options) => {
try {
await databaseService.deleteDatabase(databaseId, options);
}
catch (error) {
console.error(chalk_1.default.red('โ Database deletion failed:'), error.message);
process.exit(1);
}
});
// ๐ก๏ธ Security Commands
program
.command('security:certs')
.description('List SSL certificates')
.option('--status <status>', 'Filter by status (valid|expiring|expired)')
.action(async (options) => {
try {
await securityService.listCertificates(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Certificate list failed:'), error.message);
process.exit(1);
}
});
program
.command('security:renew <cert-id>')
.description('Renew SSL certificate')
.action(async (certId) => {
try {
await securityService.renewCertificate(certId);
}
catch (error) {
console.error(chalk_1.default.red('โ Certificate renewal failed:'), error.message);
process.exit(1);
}
});
program
.command('security:tokens')
.description('List API tokens')
.action(async () => {
try {
await securityService.listTokens();
}
catch (error) {
console.error(chalk_1.default.red('โ Token list failed:'), error.message);
process.exit(1);
}
});
program
.command('security:token:create')
.description('Create new API token')
.option('--name <name>', 'Token name')
.option('--permissions <perms>', 'Comma-separated permissions')
.option('--expires <duration>', 'Expiry duration (30d|90d|365d|never)')
.option('--no-interactive', 'Skip interactive prompts')
.action(async (options) => {
try {
if (options.permissions) {
options.permissions = options.permissions.split(',');
}
await securityService.createToken(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Token creation failed:'), error.message);
process.exit(1);
}
});
program
.command('security:token:revoke <token-id>')
.description('Revoke API token')
.action(async (tokenId) => {
try {
await securityService.revokeToken(tokenId);
}
catch (error) {
console.error(chalk_1.default.red('โ Token revocation failed:'), error.message);
process.exit(1);
}
});
program
.command('security:events')
.description('List security events')
.option('--type <type>', 'Filter by type (login|deployment|access|error)')
.option('--status <status>', 'Filter by status (success|failed)')
.option('--limit <number>', 'Limit number of results', '50')
.action(async (options) => {
try {
await securityService.listSecurityEvents(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Security events failed:'), error.message);
process.exit(1);
}
});
// ๐ Enhanced Application Commands
program
.command('apps:list')
.description('List all applications')
.option('--platform <platform>', 'Filter by platform (coolify|caprover)')
.option('--status <status>', 'Filter by status (running|stopped|deploying|failed)')
.action(async (options) => {
try {
await deploymentService.listApplications(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Application list failed:'), error.message);
process.exit(1);
}
});
program
.command('apps:create')
.description('Create new application')
.option('--name <name>', 'Application name')
.option('--repository <repo>', 'Repository URL')
.option('--branch <branch>', 'Git branch', 'main')
.option('--platform <platform>', 'Platform (coolify|caprover)', 'coolify')
.option('--environment <env>', 'Environment (production|staging|development)', 'production')
.option('--no-interactive', 'Skip interactive prompts')
.action(async (options) => {
try {
await deploymentService.createApplication(options);
}
catch (error) {
console.error(chalk_1.default.red('โ Application creation failed:'), error.message);
process.exit(1);
}
});
program
.command('apps:deploy <uuid>')
.description('Deploy application')
.option('--branch <branch>', 'Git branch to deploy')
.option('--environment <env>', 'Target environment')
.action(async (uuid, options) => {
try {
await deploymentService.deployApplication(uuid, options);
}
catch (error) {
console.error(chalk_1.default.red('โ Application deployment failed:'), error.message);
process.exit(1);
}
});
program
.command('apps:logs <uuid>')
.description('Get application logs')
.option('--lines <number>', 'Number of lines to show', '100')
.option('--deployment <id>', 'Specific deployment ID')
.action(async (uuid, options) => {
try {
await deploymentService.getApplicationLogs(uuid, options);
}
catch (error) {
console.error(chalk_1.default.red('โ Application logs failed:'), error.message);
process.exit(1);
}
});
program
.command('apps:stop <uuid>')
.description('Stop application')
.action(async (uuid) => {
try {
await deploymentService.stopApplication(uuid);
}
catch (error) {
console.error(chalk_1.default.red('โ Application stop failed:'), error.message);
process.exit(1);
}
});
program
.command('apps:start <uuid>')
.description('Start application')
.action(async (uuid) => {
try {
await deploymentService.startApplication(uuid);
}
catch (error) {
console.error(chalk_1.default.red('โ Application start failed:'), error.message);
process.exit(1);
}
});
// Parse arguments
// ๐ Vercel-like Deployment Commands (Windows Native)
program
.command('deploy')
.description('๐ Deploy like Vercel (npx vercel --prod)')
.option('--prod', 'Deploy to production')
.option('--preview', 'Deploy to preview environment')
.option('--app <uuid>', 'Application UUID')
.option('--branch <branch>', 'Git branch to deploy')
.option('--tag <tag>', 'Git tag to deploy')
.option('--no-build', 'Skip build step')
.option('--yes', 'Skip confirmation prompts')
.action(async (options) => {
try {
const result = await vercelLikeService.deploy(options);
if (!result.success) {
process.exit(1);
}
}
catch (error) {
console.error(chalk_1.default.red('โ Deployment failed:'), error.message);
process.exit(1);
}
});
// ๐ช Windows Native Commands
program
.command('windows')
.description('๐ช Windows native functionality (no WSL required)')
.addCommand(new commander_1.Command('check')
.description('๐ Check Windows environment and tools')
.action(async () => {
try {
await windowsService.checkWindowsEnvironment();
}
catch (error) {
console.error(chalk_1.default.red('โ Windows check failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('setup-ssh')
.description('๐ Setup SSH keys using Windows native tools')
.action(async () => {
try {
const success = await windowsService.setupWindowsSSH();
if (!success) {
console.log(chalk_1.default.yellow('\n๐ก Manual setup may be required'));
windowsService.showWindowsSetupInstructions();
}
}
catch (error) {
console.error(chalk_1.default.red('โ SSH setup failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('install-ssh')
.description('๐ฅ Install OpenSSH client (requires admin)')
.action(async () => {
try {
const success = await windowsService.installOpenSSH();
if (!success) {
process.exit(1);
}
}
catch (error) {
console.error(chalk_1.default.red('โ OpenSSH installation failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('test')
.description('๐งช Test all Windows native functionality')
.action(async () => {
try {
const success = await windowsService.testWindowsFunctionality();
if (!success) {
process.exit(1);
}
}
catch (error) {
console.error(chalk_1.default.red('โ Windows test failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('info')
.description('โน๏ธ Show Windows system information')
.action(async () => {
try {
await windowsService.getSystemInfo();
}
catch (error) {
console.error(chalk_1.default.red('โ System info failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('help')
.description('๐ Show Windows-specific setup guide')
.action(() => {
windowsService.showWindowsSetupInstructions();
}));
// ๐ Enhanced Coolify Commands (Battle-tested patterns)
program
.command('coolify')
.description('๐ Enhanced Coolify integration with PR previews')
.addCommand(new commander_1.Command('health')
.description('๐ฅ Check Coolify server health')
.action(async () => {
try {
await coolifyService.healthCheck();
}
catch (error) {
console.error(chalk_1.default.red('โ Health check failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('login')
.description('๐ Authenticate with Coolify using API token')
.option('--url <url>', 'Coolify instance URL')
.option('--token <token>', 'API token')
.action(async (options) => {
try {
const url = options.url || 'https://coolify.aerocorpindustries.org';
const token = options.token || process.env.COOLIFY_TOKEN;
if (!token) {
console.log(chalk_1.default.red('โ API token required'));
console.log(chalk_1.default.yellow('๐ก Set COOLIFY_TOKEN environment variable or use --token'));
console.log(chalk_1.default.blue('๐ Generate token at: Dashboard โ Keys & Tokens โ API tokens'));
process.exit(1);
}
const success = await coolifyService.setupAuth(url, token);
if (!success) {
process.exit(1);
}
}
catch (error) {
console.error(chalk_1.default.red('โ Login failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('deploy')
.description('๐ Deploy application to Coolify')
.argument('<app>', 'Application UUID or name')
.option('--tag <tag>', 'Git tag to deploy')
.option('--branch <branch>', 'Git branch to deploy')
.option('--environment <env>', 'Target environment', 'production')
.action(async (app, options) => {
try {
await coolifyService.deploy({
uuid: app,
tag: options.tag,
branch: options.branch,
environment: options.environment
});
}
catch (error) {
console.error(chalk_1.default.red('โ Deployment failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('apps')
.description('๐ List Coolify applications')
.action(async () => {
try {
const apps = await coolifyService.listApplications();
if (apps.length === 0) {
console.log(chalk_1.default.yellow('๐ No applications found'));
return;
}
console.log(chalk_1.default.cyan(`\n๐ Coolify Applications (${apps.length}):`));
console.log(chalk_1.default.gray('โ'.repeat(80)));
apps.forEach((app, index) => {
console.log(chalk_1.default.white(`${index + 1}. ${app.name}`));
console.log(chalk_1.default.gray(` UUID: ${app.uuid}`));
console.log(chalk_1.default.gray(` Status: ${app.status || 'Unknown'}`));
if (app.url) {
console.log(chalk_1.default.blue(` URL: ${app.url}`));
}
console.log('');
});
}
catch (error) {
console.error(chalk_1.default.red('โ Failed to list applications:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('logs')
.description('๐ Get application logs (API + SSH fallback)')
.argument('<app>', 'Application UUID')
.option('--lines <number>', 'Number of lines to show', '100')
.option('--follow', 'Follow logs in real-time')
.option('--ssh', 'Force SSH method (Windows native)')
.option('--wsl', 'Force WSL method (if available)')
.action(async (app, options) => {
try {
const lines = parseInt(options.lines);
if (options.ssh) {
// Use Windows native SSH
console.log(chalk_1.default.blue('๐ช Using Windows native SSH for logs...'));
await sshService.getDockerLogs(app, {
lines,
follow: options.follow
});
}
else if (options.wsl) {
// Use WSL method (if available)
console.log(chalk_1.default.blue('๐ง Using WSL for logs...'));
await wslService.getDockerLogs({
applicationId: app,
lines,
follow: options.follow
});
}
else {
// Try API first, fallback to SSH
try {
console.log(chalk_1.default.blue('๐ Fetching logs via Coolify API...'));
await coolifyService.getLogs(app, lines);
}
catch (apiError) {
console.log(chalk_1.default.yellow('โ ๏ธ API method failed, falling back to SSH...'));
// Check platform and use appropriate SSH method
if (process.platform === 'win32') {
console.log(chalk_1.default.blue('๐ช Using Windows native SSH fallback...'));
await sshService.getDockerLogs(app, { lines, follow: options.follow });
}
else {
console.log(chalk_1.default.blue('๐ง Using WSL SSH fallback...'));
await wslService.getDockerLogs({
applicationId: app,
lines,
follow: options.follow
});
}
}
}
}
catch (error) {
console.error(chalk_1.default.red('โ Failed to get logs:'), error.message);
console.log(chalk_1.default.yellow('\n๐ก Troubleshooting:'));
console.log(chalk_1.default.blue(' โข Check application UUID is correct'));
console.log(chalk_1.default.blue(' โข Verify API token has proper permissions'));
console.log(chalk_1.default.blue(' โข Test SSH connectivity: aerocorp windows test'));
process.exit(1);
}
}));
// ๐ PR Preview Commands
program
.command('preview')
.description('๐ PR Preview deployments')
.addCommand(new commander_1.Command('up')
.description('๐ Create PR preview deployment')
.option('--pr <number>', 'Pull request number', parseInt)
.option('--app <uuid>', 'Application UUID')
.option('--branch <branch>', 'Git branch name')
.option('--subdomain <subdomain>', 'Custom subdomain')
.action(async (options) => {
try {
if (!options.pr || !options.app || !options.branch) {
console.log(chalk_1.default.red('โ Missing required options'));
console.log(chalk_1.default.yellow('๐ก Usage: aerocorp preview up --pr <number> --app <uuid> --branch <branch>'));
process.exit(1);
}
await coolifyService.createPreview({
pr: options.pr,
app: options.app,
branch: options.branch,
subdomain: options.subdomain
});
}
catch (error) {
console.error(chalk_1.default.red('โ Preview creation failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('down')
.description('๐๏ธ Destroy PR preview deployment')
.option('--pr <number>', 'Pull request number', parseInt)
.option('--app <uuid>', 'Application UUID')
.action(async (options) => {
try {
if (!options.pr || !options.app) {
console.log(chalk_1.default.red('โ Missing required options'));
console.log(chalk_1.default.yellow('๐ก Usage: aerocorp preview down --pr <number> --app <uuid>'));
process.exit(1);
}
await coolifyService.destroyPreview(options.pr, options.app);
}
catch (error) {
console.error(chalk_1.default.red('โ Preview destruction failed:'), error.message);
process.exit(1);
}
}));
// ๐ง WSL Integration Commands
program
.command('wsl')
.description('๐ง WSL integration for SSH and Docker operations')
.addCommand(new commander_1.Command('info')
.description('โน๏ธ Show WSL environment information')
.action(async () => {
try {
await wslService.getWSLInfo();
}
catch (error) {
console.error(chalk_1.default.red('โ WSL info failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('setup-ssh')
.description('๐ Setup SSH keys for Coolify server')
.action(async () => {
try {
await wslService.interactiveSSHSetup();
}
catch (error) {
console.error(chalk_1.default.red('โ SSH setup failed:'), error.message);
process.exit(1);
}
}))
.addCommand(new commander_1.Command('test')
.description('๐งช Test WSL and SSH connectivity')
.action(async () => {
try {
const wslOk = await wslService.checkWSLAvailability();
const sshOk = await wslService.testSSHConnection();
if (wslOk && sshOk) {
console.log(chalk_1.default.green.bold('\n๐ All systems operational!'));
}
else {
console.log(chalk_1.default.yellow('\nโ ๏ธ Some issues detected. Run setup commands to fix.'));
}
}
catch (error) {
console.error(chalk_1.default.red('โ Test failed:'), error.message);
process.exit(1);
}
}));
program.parse();
//# sourceMappingURL=cli.js.map