/** * Version command for CLI. * * Shows the Coolify server version. * * @module */ import { isErr } from "@mks2508/no-throw"; import chalk from "chalk"; import { getCoolifyService } from "../../coolify/index.js"; /** * Version command handler. * Displays the Coolify server version. */ export async function versionCommand() { const coolify = getCoolifyService(); const initResult = await coolify.init(); if (isErr(initResult)) { console.error(chalk.red(`Error: ${initResult.error.message}`)); return; } const result = await coolify.getVersion(); if (isErr(result)) { console.error(chalk.red(`Error: ${result.error.message}`)); return; } console.log( chalk.cyan("Coolify Server Version:"), chalk.bold(result.value.version), ); }