From fef40bc614ead3630cea39c479a342cdbd307158 Mon Sep 17 00:00:00 2001 From: Volodymyr Vreshch Date: Tue, 19 May 2026 10:00:00 +0000 Subject: [PATCH] chore(cli): route update notice to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The update notice was written to stdout (TTY-guarded). Stdout pollution is a known concern in this file — the surrounding comment already calls out that non-TTY stdout corrupts --json consumers. Routing to stderr keeps stdout pure regardless of TTY state. --- src/cli.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index e957370..8bcab2d 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -57,7 +57,11 @@ program.parseAsync().then(async () => { const result = await updateCheckPromise; if (result?.updateAvailable) { const { default: chalk } = await import('chalk'); - console.log( + // Route to stderr — the update notice is meta-information, not command + // output. Even with the TTY guard above, keeping stdout pure means + // consumers that capture stdout (e.g. `agentage status | jq`) never + // see this string in their pipeline. + console.error( chalk.yellow( `\nUpdate available: ${result.currentVersion} → ${result.latestVersion} — run ${chalk.white('agentage update')} to install.` )