From e38af6ad6e2f65a73b4d16f6b4f0cead2eb7374d Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Thu, 25 Dec 2025 04:53:32 -0500 Subject: [PATCH] fix(ui): initialize colors early for consistent status output Call initUI() at the start of main() to ensure chalk is loaded before any status messages. Previously, colors only worked when an update notification was displayed because showUpdateNotification() was the only place calling initUI(). Fixes #201 --- src/ccs.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ccs.ts b/src/ccs.ts index 9999428b..0f075d6d 100644 --- a/src/ccs.ts +++ b/src/ccs.ts @@ -255,6 +255,13 @@ async function main(): Promise { const args = process.argv.slice(2); const firstArg = args[0]; + // Initialize UI colors early to ensure consistent colored output + // Must happen before any status messages (ok, info, fail, etc.) + if (process.stdout.isTTY && !process.env['CI']) { + const { initUI } = await import('./utils/ui'); + await initUI(); + } + // Trigger update check early for ALL commands except version/help/update // Only if TTY and not CI to avoid noise in automated environments const skipUpdateCheck = [