/** * Cancel deploy command for CLI. * * Cancels an in-progress deployment. * * @module */ import { isErr } from "@mks2508/no-throw"; import chalk from "chalk"; import { getCoolifyService } from "../../coolify/index.js"; /** * Cancel deploy command handler. * * @param deploymentUuid - Deployment UUID to cancel */ export async function cancelDeployCommand(deploymentUuid: string) { const coolify = getCoolifyService(); const initResult = await coolify.init(); if (isErr(initResult)) { console.error(chalk.red(`Error: ${initResult.error.message}`)); return; } const result = await coolify.cancelDeployment(deploymentUuid); if (isErr(result)) { console.error(chalk.red(`Error: ${result.error.message}`)); return; } console.log(chalk.green(`Deployment ${deploymentUuid} cancelled`)); }