CLI commands emit raw ANSI escape characters when output is redirected to a file or piped to another program.
Reproduction:
agentcore import --source my-agent.yaml 2> log.txt
cat log.txt
Expected:
[error] Import failed: Source file not found: my-agent.yaml
Actual:
\x1b[31m[error]\x1b[0m Import failed: Source file not found: my-agent.yaml
This affects any non-TUI command that writes colored output (e.g. agentcore import). The NO_COLOR (https://no-color.org/) environment variable is also not respected.
CLI commands emit raw ANSI escape characters when output is redirected to a file or piped to another program.
Reproduction:
Expected:
Actual:
This affects any non-TUI command that writes colored output (e.g. agentcore import). The NO_COLOR (https://no-color.org/) environment variable is also not respected.