<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8" -->

---
title: FORCE_COLOR: Keep Your Command Line Colorful, Even when...
description: An informal standard proposed in 2023 defines the FORCE_COLOR environment variable, letting users force ANSI color output in command-line programs even when...
canonical: https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: FORCE_COLOR: Keep Your Command Line Colorful, Even when Piping - Retain Text Colors in Logs, Output Streams, and More | daily.dev
og:description: An informal standard proposed in 2023 defines the FORCE_COLOR environment variable, letting users force ANSI color output in command-line programs even when...
og:url: https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8
og:image: https://api.daily.dev/og/posts/hXXTJOxJ8.png
og:image:alt: FORCE_COLOR: Keep Your Command Line Colorful, Even when Piping - Retain Text Colors in Logs, Output Streams, and More
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# FORCE_COLOR: Keep Your Command Line Colorful, Even when Piping - Retain Text Colors in Logs, Output Streams, and More

**[Lobsters](https://daily.dev/sources/lobsters)** · 3 min read · 0 upvotes · 0 comments

## Summary

An informal standard proposed in 2023 defines the FORCE_COLOR environment variable, letting users force ANSI color output in command-line programs even when output is piped or run in CI, where color is normally auto-disabled. The variable complements NO_COLOR and works even in cases where --color flags can't be applied, such as internal piping. A C example implementation is shown, along with lists of libraries (chalk, rich, colorette, termcolor, supports-color, gookit/color, ansis, Warna) and software that already support it, with links for contributing further additions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://force-color.org/>

## Questions this post answers

### What does the FORCE_COLOR environment variable do in command-line tools?

FORCE_COLOR is an informal standard, proposed in 2023, that tells command-line software to force ANSI color output whenever the variable is set to a non-empty value, regardless of its value. It addresses cases where color is normally disabled automatically, such as piping output through less, grep, or tee, or running in CI environments detected as non-interactive.

_daily.dev surfaces cli tooling standards like this for developers debugging inconsistent terminal output._

### Why doesn't the --color flag work when piping command output to another program?

The --color or -c flag has to be passed externally to the program being run, but when output is being piped internally between programs, there is no way to attach that flag to the internal call. FORCE_COLOR solves this because it is read from the environment rather than passed as a command-line argument, so it applies even to internally piped processes.

_developers wiring up piped cli workflows can track environment-based conventions like this on daily.dev._

### Which JavaScript and Python color libraries support the FORCE_COLOR environment variable?

Several libraries support FORCE_COLOR, including chalk (since v1.0.0, 2015-02-23), supports-color (v3.0.0, 2015-07-15), colorette (v1.0.0, 2018-07-13), ansis (v3.1.1, 2024-04-15), Python's rich (v12.6.0, 2022-10-02) and termcolor (v2.1.0, 2022-10-30), Go's gookit/color (v1.4.1, 2021-04-07), and Warna (v0.1.0, 2024-02-11).

_daily.dev helps developers compare which terminal color libraries already support conventions like FORCE_COLOR._

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 10 comments across lobsters, hackernews (as of 2026-09-04).

**TL;DR:** The reception is largely negative, with commenters arguing FORCE_COLOR undermines NO_COLOR by overriding user preferences, and pointing to real-world bugs and confusion it has caused in tools like Node, Playwright, and pytest.

**Sentiment:** 0% positive · 10% mixed · 90% skeptical

**The pushback**

- It overrides a user's explicit NO_COLOR setting, defeating the purpose of that standard.
- Setting FORCE_COLOR to '0' or an empty string paradoxically turns color on instead of off, which is seen as a serious footgun.
- The proposal has caused real disruption, with numerous issues filed against projects like Playwright and pytest.
- Some feel the whole effort misunderstands why NO_COLOR exists, conflating disabling colors with disabling other terminal behaviors like progress bars.

**By community**

- lobsters (skeptical): Commenters see FORCE_COLOR as actively hostile to NO_COLOR users, citing real bugs and calling the design philosophy misguided.
- hackernews (mixed): No comments were available to gauge sentiment.

**Hottest debate:** Whether FORCE_COLOR is a well-intentioned but flawed standard or a project that fundamentally undermines user control established by NO_COLOR.

**Open questions**

- Will tools need yet another override variable to counteract FORCE_COLOR overriding NO_COLOR?
- Is the empty-string-enables-color behavior a bug in Node or an intentional part of the spec?

**Highlights**

> It's made even worse by the fact that setting `FORCE_COLOR` to `0` or [even the empty string](https://github.com/nodejs/node/blob/main/lib/internal/util/colors.js#L19) is equivalent to *turning it on*. This is cruel beyond belief.  ```  FORCE_COLOR=  npx playwright test ./tests (node:21045) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. (Use `node --trace-warnings ...` to show where the warning was created) ```
> — [pzel on lobsters · 5 points, 1 comments](https://lobste.rs/s/qnjllv/force_color_keep_your_command_line#c_ji7ezh)

> Sadly it's all in earnest. I think I need to take a break after [reading parts of the design discussion](https://github.com/donatj/force-color.org/issues/8), full of tasteful wisdom such as: > The reason NO_COLOR came to be in the first place is because some people dislike colored output and want to be able to disable it at the shell profile level. They wouldn't want or expect for it to stop other things like animated progress bars and other fancy output from working correctly. I hope Rob Pike drops down the chimney on Christmas Eve and gives the author a huge lump of coal and a stern talking-to about progress bars and other tty abuses.
> — [pzel on lobsters · 2 points](https://lobste.rs/s/qnjllv/force_color_keep_your_command_line#c_heshco)

> Oh yeah it's real, and my head is reeling from the sheer blast radius. It turns out Playwright has [seventeen issues mentioning this flag](https://github.com/microsoft/playwright/issues?q=is%3Aissue%20state%3Aclosed%20FORCE_COLOR).  I suspect that this is a troll project run wild, which helps a bit with the engineering vertigo.
> — [pzel on lobsters · 4 points, 1 comments](https://lobste.rs/s/qnjllv/force_color_keep_your_command_line#c_wbcg84)

> the year is 2040, we got a tower of color-switching environment variables and no one has an idea of how the whole thing works… ``` FORCE_FORCE_FORCE_FORCE_FORCE_COLOR FORCE_FORCE_FORCE_FORCE_NO_COLOR NO_FORCE_FORCE_FORCE_FORCE_COLOR FORCE_FORCE_FORCE_FORCE_COLOR FORCE_FORCE_FORCE_NO_COLOR NO_FORCE_FORCE_FORCE_COLOR FORCE_FORCE_FORCE_COLOR FORCE_FORCE_NO_COLOR NO_FORCE_FORCE_COLOR FORCE_FORCE_COLOR FORCE_NO_COLOR NO_FORCE_COLOR FORCE_COLOR NO_COLOR ```
> — [FedericoSchonborn on lobsters · 2 points, 1 comments](https://lobste.rs/s/qnjllv/force_color_keep_your_command_line#c_yuj9hz)

> I thought this was joking, but it's apparently real: https://github.com/pytest-dev/pytest/issues/7464
> — [hoistbypetard on lobsters · 4 points, 2 comments](https://lobste.rs/s/qnjllv/force_color_keep_your_command_line#c_nroskz)

**Source threads**

- [lobsters](https://lobste.rs/s/qnjllv/force_color_keep_your_command_line) · 3 points · 10 comments
- [hackernews](https://news.ycombinator.com/item?id=37510432) · 1 points · 0 comments

## Similar posts on daily.dev

- [How to Choose Colors for Your CLI Applications · Luna’s Blog](https://daily.dev/posts/how-to-choose-colors-for-your-cli-applications-luna-s-blog-x2oqdb1mz) · Hacker News · 1 upvotes · 1 comments
- [Fish 4.6 Shell Brings Support For Recent systemd Environment Variables](https://daily.dev/posts/fish-4-6-shell-brings-support-for-recent-systemd-environment-variables-4v1vdadh1) · Phoronix · 0 upvotes · 0 comments
- [Reclaim the terminal](https://daily.dev/posts/reclaim-the-terminal-ljfze3w0a) · Lobsters · 0 upvotes · 0 comments
- [The Universe of Discourse : An anecdote about backward compatibility](https://daily.dev/posts/the-universe-of-discourse-an-anecdote-about-backward-compatibility-o6cqrjnl0) · Planet Haskell · 2 upvotes · 0 comments

---

Tags: [#cicd](https://daily.dev/tags/cicd), [#cli](https://daily.dev/tags/cli)

[View this post on daily.dev](https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"FORCE_COLOR: Keep Your Command Line Colorful, Even when Piping - Retain Text Colors in Logs, Output Streams, and More","url":"https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8"},"datePublished":"2026-09-04T20:09:48.605Z","dateModified":"2026-09-04T22:27:03.198Z","description":"An informal standard proposed in 2023 defines the FORCE_COLOR environment variable, letting users force ANSI color output in command-line programs even when...","image":"https://media.daily.dev/image/upload/s--P4t4XyoV--/f_auto/v1722860399/public/Placeholder%2001","thumbnailUrl":"https://media.daily.dev/image/upload/s--P4t4XyoV--/f_auto/v1722860399/public/Placeholder%2001","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cicd,cli","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"FORCE_COLOR: Keep Your Command Line Colorful, Even when Piping - Retain Text Colors in Logs, Output Streams, and More"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/force-color-keep-your-command-line-colorful-even-when-piping---retain-text-colors-in-logs-output--hxxtjoxj8#faq","mainEntity":[{"@type":"Question","name":"What does the FORCE_COLOR environment variable do in command-line tools?","acceptedAnswer":{"@type":"Answer","text":"FORCE_COLOR is an informal standard, proposed in 2023, that tells command-line software to force ANSI color output whenever the variable is set to a non-empty value, regardless of its value. It addresses cases where color is normally disabled automatically, such as piping output through less, grep, or tee, or running in CI environments detected as non-interactive. daily.dev surfaces cli tooling standards like this for developers debugging inconsistent terminal output."}},{"@type":"Question","name":"Why doesn't the --color flag work when piping command output to another program?","acceptedAnswer":{"@type":"Answer","text":"The --color or -c flag has to be passed externally to the program being run, but when output is being piped internally between programs, there is no way to attach that flag to the internal call. FORCE_COLOR solves this because it is read from the environment rather than passed as a command-line argument, so it applies even to internally piped processes. developers wiring up piped cli workflows can track environment-based conventions like this on daily.dev."}},{"@type":"Question","name":"Which JavaScript and Python color libraries support the FORCE_COLOR environment variable?","acceptedAnswer":{"@type":"Answer","text":"Several libraries support FORCE_COLOR, including chalk (since v1.0.0, 2015-02-23), supports-color (v3.0.0, 2015-07-15), colorette (v1.0.0, 2018-07-13), ansis (v3.1.1, 2024-04-15), Python's rich (v12.6.0, 2022-10-02) and termcolor (v2.1.0, 2022-10-30), Go's gookit/color (v1.4.1, 2021-04-07), and Warna (v0.1.0, 2024-02-11). daily.dev helps developers compare which terminal color libraries already support conventions like FORCE_COLOR."}}]}
```

