import { exec } from "child_process"; import { promisify } from "util"; import chalk from "chalk"; import ora from "ora"; const execAsync = promisify(exec); export async function execCommand( command: string, cwd: string, description: string ): Promise { const spinner = ora(description).start(); try { await execAsync(command, { cwd }); spinner.succeed(chalk.green(description)); } catch (error) { spinner.fail(chalk.red(`Failed: ${description}`)); throw error; } } export function log(message: string): void { console.log(chalk.cyan(message)); } export function logSuccess(message: string): void { console.log(chalk.green(`✓ ${message}`)); } export function logError(message: string): void { console.log(chalk.red(`✗ ${message}`)); } export function logWarning(message: string): void { console.log(chalk.yellow(`⚠ ${message}`)); }