Skip to content

Suppress version hints when stderr is not a TTY#562

Draft
dan-manges wants to merge 1 commit into
mainfrom
suppress-version-hints-non-tty
Draft

Suppress version hints when stderr is not a TTY#562
dan-manges wants to merge 1 commit into
mainfrom
suppress-version-hints-non-tty

Conversation

@dan-manges

Copy link
Copy Markdown
Member

What

Automatically suppress the two stderr "nag" hints — the CLI upgrade hint ("A new release of rwx is available…") and the agent-skill hint ("A new version of the RWX agent skill is available…") — when stderr is not a terminal.

Why

When rwx runs inside a script, pipeline, or CI job, these hints add noise to captured output. Previously the only way to silence them was to set an env var explicitly. Now scripts get clean output by default.

How

Both hints write to s.Stderr, and the CLI already detects whether stderr is a terminal via Config.StderrIsTTY (set in cmd/rwx/root.go using term.IsTerminal). The change adds a !s.StderrIsTTY guard to each hint function in internal/cli/service.go — no new plumbing, env vars, or fields.

The existing env-var opt-outs (RWX_HIDE_LATEST_VERSION / legacy MINT_HIDE_LATEST_VERSION, and RWX_HIDE_SKILL_HINT) remain as explicit overrides for users who want to suppress hints even in an interactive terminal.

Behavior change to note

Most CI runners present stderr as a non-TTY, so upgrade/skill hints will no longer appear in CI logs. This is the intended outcome of "disable hints in scripts."

Tests

  • Added a negative subtest covering non-TTY suppression of the skill hint.
  • Updated the existing positive skill-hint test to set StderrIsTTY: true (it previously relied on the default false).
  • go build ./cmd/rwx and go test ./internal/cli/... ./cmd/... pass.

🤖 Generated with Claude Code

The CLI upgrade hint and agent-skill hint added noise to captured output
when rwx is used in scripts, pipelines, or CI. Both hints write to stderr,
so gate them on Config.StderrIsTTY: when stderr is not a terminal, suppress
automatically. The existing RWX_HIDE_LATEST_VERSION / MINT_HIDE_LATEST_VERSION
/ RWX_HIDE_SKILL_HINT env vars remain as explicit overrides.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant