Problem
ANSI color codes are hardcoded throughout the CLI output. Colors are emitted even when:
- stdout is piped to a file or another process
- the
NO_COLOR env var is set (community standard: https://no-color.org)
What to implement
- NO_COLOR support: when
NO_COLOR is set (any value), suppress all ANSI escape sequences
- TTY detection: when stdout is not a terminal, strip ANSI automatically
- Apply to all output in
main.rs and claude_code.rs where ANSI codes are used
Approach
Add a helper (e.g. in a small output.rs module or inline):
fn color_enabled() -> bool {
std::io::stdout().is_terminal() && std::env::var("NO_COLOR").is_err()
}
Then gate the existing ANSI escape constants on this check.
Files to touch
src/main.rs — version banner, test output, summary formatting
src/claude_code.rs — provider output formatting (lines 8-28 define color constants)
Problem
ANSI color codes are hardcoded throughout the CLI output. Colors are emitted even when:
NO_COLORenv var is set (community standard: https://no-color.org)What to implement
NO_COLORis set (any value), suppress all ANSI escape sequencesmain.rsandclaude_code.rswhere ANSI codes are usedApproach
Add a helper (e.g. in a small
output.rsmodule or inline):Then gate the existing ANSI escape constants on this check.
Files to touch
src/main.rs— version banner, test output, summary formattingsrc/claude_code.rs— provider output formatting (lines 8-28 define color constants)