Skip to content

chore: color output to CLI#55

Merged
cdklabs-automation merged 3 commits intomainfrom
behuang/cli_add_colors
Nov 21, 2025
Merged

chore: color output to CLI#55
cdklabs-automation merged 3 commits intomainfrom
behuang/cli_add_colors

Conversation

@huang-benny
Copy link
Contributor

@huang-benny huang-benny commented Nov 20, 2025

Enhances the CLI output with colors using chalk to improve readability

Changes

  • Visual improvements:

    • Library name and version displayed in blue
    • Overall score color-coded based on value:
      • Green for scores ≥80
      • Yellow for scores ≥60
      • Red for scores <60
    • Subscore labels in cyan with color-coded values
    • Star ratings with yellow for filled stars (★) and gray for empty stars (☆)
    • Separators and dots in gray for reduced visual noise
    • Error messages in red
  • Test updates:

    • Updated CLI tests to handle chalk's multi-argument console.log calls
    • Tests now verify content presence rather than exact formatting
    • Added chalk.level = 0 to disable colors in test environment

    New CLI Output example:

Screenshot 2025-11-21 at 11 02 37 AM

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a visual change you should include what the change looks like in pr description

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am approving for now -- this works and I am happy with it.

HOWEVER, think about how you might refactor this to be more maintainable, say i want to change your chalk.cyan color to something else. we might come back to this refactor opportunity later.

Comment on lines +5 to +7
// Disable chalk colors for testing
chalk.level = 0;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmao i assume q came up with this but its actually a good idea

@cdklabs-automation cdklabs-automation added this pull request to the merge queue Nov 21, 2025
Merged via the queue into main with commit 359b0a9 Nov 21, 2025
7 checks passed
@cdklabs-automation cdklabs-automation deleted the behuang/cli_add_colors branch November 21, 2025 17:47
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.

3 participants