1. License
“to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”
MIT allows use in paid and closed-source products.
github.com/chalk/chalk/blob/main/license3. Used by agents' projects
Dependency in 181 public GitHub projects set up for AI coding agents that we scanned (2.9%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What chalk does
chalk is a free JavaScript package that colors the messages a command-line program prints, so errors show in red and success in green. It checks whether the screen can show color and leaves plain text when it cannot. It styles terminal and browser console text, not the text on your web pages.
What people build with it
Readable build and deploy reports
Your deploy or setup script prints many lines; success turns green, warnings orange and errors bold red, so problems stand out at a glance.
Plain text in log files
When the same program writes to a log file or a build server, color codes would be clutter; chalk can be set to print plain text.
Your brand color in a command-line tool
A banner or prompt in your own command-line tool uses the exact hex color of your brand, not just the basic 16 colors.
Check color names users type
Your tool lets people pick colors in a settings file; check each name against chalk's own list before using it.
Separate colors for error output
Your program sends normal output to one place and errors to another; chalkStderr picks colors for the error stream on its own.
Highlight failed checks for an assistant Idea
A check script that your AI assistant runs prints failures in red and a short green summary, so you see the result in the chat log.
chalk popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How chalk is used
- chalk is a dependency in 181 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (3.7% of the 4,867 JavaScript/TypeScript ones), #9 of 299 in dev workflow and config.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 570; those are left out of every share on this page.
- Projects that use it most often also use Commander (64.6%), tsx (55.8%), dotenv (52.5%).
- It is more common in projects set up for OpenClaw (14.1%) than for GitHub Copilot (2.2%).
By coding agent
Often used with
More about chalk
Funding
- GitHub Sponsors: https://github.com/sindresorhus
- GitHub Sponsors: https://github.com/Qix-
- Open Collective: https://opencollective.com/sindresorhus
- Tidelift: https://tidelift.com/funding/github/npm/chalk
- Own page: https://sindresorhus.com/donate
- Own page: https://github.com/chalk/chalk?sponsor=1
- 186 GitHub sponsors
Agent Skills for it
- chalk-logic: Create Chalk Logic concept-led chalkboard illustrations from briefs. Use for sparse wordless chalkboard explanations, non-diagram editorial
More in Dev workflow and config
Alternatives
chalk This page
Pick picocolors when you only need basic terminal colors and want the smallest possible package.
Pick Rich when your command-line program is written in Python; it also draws tables and progress bars.
Pick boxen when you want a framed box around a message, such as an update notice; it can sit next to chalk.
Get started
Tell your AI assistant
“Add chalk 6.0.1 as an exact dependency (Node.js 22+, ESM import) and color my CLI output with one theme object (green success, orange warnings, bold red errors), using new Chalk({ level }) instead of changing chalk.level globally.”
Install chalk in a project that runs on Node.js 22 or newer.
npm install chalkImport it and wrap the text you print. Styles chain, and you can nest them.
import chalk from 'chalk'; console.log(chalk.blue('Hello world!'));To force colors on or off without code changes, set FORCE_COLOR when you run the program.
FORCE_COLOR=0 node build.js
Mistakes to avoid
chalk 5 and later ship only as ESM.
chalk 6.0.0 raised the minimum to Node.js 22 (package.json engines "node" ">=22").
The level property is shared by every chalk user in the same program.
5.6.1 was a harmful release pushed to the registry; 5.6.2 replaced it.
Underline colors only show together with an underline style, and many terminals ignore them.
Questions
Can I load it with require() in an older CommonJS project?
Versions 5 and 6 are loaded with import. The readme suggests staying on chalk 4 if your TypeScript or build setup cannot handle that.
How do I turn colors off for a log file?
Set FORCE_COLOR=0 when you run the program, or create new Chalk({ level: 0 }) in your code.
Does it work in the browser?
Only in the developer console, which shows the color codes in Chrome since version 69. It does not style page text.
Does it pull in other packages?
No. The readme says chalk has no dependencies.