Skip to content

feat: add --no-color option for CLI output (#1091)#10887

Open
jashwanth-reddy-g wants to merge 2 commits into
aquasecurity:mainfrom
jashwanth-reddy-g:fix-1091-no-color
Open

feat: add --no-color option for CLI output (#1091)#10887
jashwanth-reddy-g wants to merge 2 commits into
aquasecurity:mainfrom
jashwanth-reddy-g:fix-1091-no-color

Conversation

@jashwanth-reddy-g

Copy link
Copy Markdown

Fixes #1091

Description

This PR adds the requested --no-color flag to Trivy's global CLI options. When passed, it globally sets color.NoColor = true (via the fatih/color package) in the root pre-run hook, ensuring that all subsequent terminal output across all commands (image, fs, config, etc.) is rendered without ANSI color escape codes. This is useful for CI/CD pipelines or logging environments where raw text is preferred over styled text.

Testing

  • Tested --no-color suppression against standard image scans.

@CLAassistant

CLAassistant commented Jun 22, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ jashwanth-reddy-g
❌ Jashwanth


Jashwanth seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

--no-color option

2 participants