feat: enable automatic prefix colors by default#581
Open
GermanJablo wants to merge 3 commits intoopen-cli-tools:mainfrom
Open
feat: enable automatic prefix colors by default#581GermanJablo wants to merge 3 commits intoopen-cli-tools:mainfrom
GermanJablo wants to merge 3 commits intoopen-cli-tools:mainfrom
Conversation
Verify that ACCEPTABLE_CONSOLE_COLORS follows the same color sequence used by turborepo: cyan, magenta, green, yellow, blue.
Change the default prefix color from 'reset' (no color) to 'auto', so that each command gets a distinct color out of the box. Set ACCEPTABLE_CONSOLE_COLORS to turborepo's 5-color palette (cyan, magenta, green, yellow, blue) which cycles on repeat. This list only controls what 'auto' picks from — manually specified colors (via --prefix-colors) are unrestricted and accept any valid Chalk color name, hex value, or modifier.
gustavohenke
requested changes
Mar 8, 2026
Member
gustavohenke
left a comment
There was a problem hiding this comment.
Absolutely on board with most changes in this PR.
Change from reset to auto default could be backed by analytics, but we don't have these at the moment.
Still, I'm inclined to accept it as a breaking change, it's just curious how it was never requested before.
Remove turborepo references from JSDoc and test. Test now validates palette properties (no bg/white/grey/black/red colors) instead of asserting a specific color list.
1e4102c to
0f12f9b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--prefix-colorsfromreset(no colors) toauto, so each command gets a distinct prefix color out of the box.colorTextfallback to handle non-Chalk values indefaults.prefixColorsgracefully.Motivation
Running
concurrently "cmd1" "cmd2" "cmd3"today produces uncolored prefixes — all[0],[1],[2]look the same unless the user explicitly passes-c autoor a color list. Colored prefixes are one of the most useful visual cues when scanning interleaved output, yet they require opting in.This PR makes colors the default. Users who prefer uncolored output can pass
-c reset.Color choice rationale
The previous
ACCEPTABLE_CONSOLE_COLORSlist had 16 entries including colors that are problematic as defaults:white/greyblend into the terminal's default text color on most themes, looking effectively uncolored.redis universally associated with errors; using it for normal output creates a false sense of alarm.bg*colors (background-colored text) are visually heavy and distracting for everyday use.The chosen 5-color palette avoids all of these: each color is clearly distinguishable, reads well on both dark and light backgrounds, and carries no semantic baggage. This is the same set of colors used by turborepo, which served as inspiration for the selection.
Default pool vs allowed colors
ACCEPTABLE_CONSOLE_COLORScontrols whatautopicks from — it is not a whitelist. Manually specified colors via--prefix-colorsremain completely unrestricted: any valid Chalk color name (red,bgCyan,greenBright, …), hex value (#23de43), or modifier (bold,inverse, …) works exactly as before. This distinction is now documented in the source.Changes
lib/defaults.tsprefixColors:'reset'→'auto'lib/prefix-color-selector.tsACCEPTABLE_CONSOLE_COLORS→ 5-color palette with updated JSDoclib/logger.tscolorTextfallback:?? this.chalk.resetfor safetylib/prefix-color-selector.spec.tsdocs/cli/prefixing.mdTesting
pnpm test -- --run lib/prefix-color-selector.spec.tsTo see the colors locally:
Commands 6 and 7 cycle back to cyan and magenta. Manual colors still work:
All 583 tests pass (582 existing + 1 new). Lint and type checks clean.
Screenshots to visualize the colors
Example from the repo: