{
 "kind": "tool",
 "slug": "chalk",
 "path": "tools/chalk/",
 "name": "chalk",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Dev workflow and config",
   "tools/dev-workflow/"
  ]
 ],
 "lead": "Colored, bold and underlined text in the terminal.",
 "chips": [
  {
   "label": "Dev workflow and config",
   "path": "tools/dev-workflow/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install chalk"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/chalk/chalk"
  },
  {
   "label": "Website",
   "href": "https://github.com/chalk/chalk#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "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",
   "note": "MIT allows use in paid and closed-source products.",
   "src": "https://github.com/chalk/chalk/blob/main/license"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Oct 22, 2026",
   "note": "Latest GitHub release Sep 27, 2026. ",
   "src": "https://github.com/chalk/chalk"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "181 projects",
   "status": "info",
   "sub": "#9 of 299 in its category",
   "note": "Dependency in 181 public GitHub projects set up for AI coding agents that we scanned (2.9%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community skills",
   "status": "info",
   "sub": "1 skills by others",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What chalk does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Readable build and deploy reports",
       "text": "Your deploy or setup script prints many lines; success turns green, warnings orange and errors bold red, so problems stand out at a glance.",
       "idea": false
      },
      {
       "title": "Plain text in log files",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Your brand color in a command-line tool",
       "text": "A banner or prompt in your own command-line tool uses the exact hex color of your brand, not just the basic 16 colors.",
       "idea": false
      },
      {
       "title": "Check color names users type",
       "text": "Your tool lets people pick colors in a settings file; check each name against chalk's own list before using it.",
       "idea": false
      },
      {
       "title": "Separate colors for error output",
       "text": "Your program sends normal output to one place and errors to another; chalkStderr picks colors for the error stream on its own.",
       "idea": false
      },
      {
       "title": "Highlight failed checks for an assistant",
       "text": "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.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "chalk popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "80",
       "of": "/ 100",
       "l": "Gid Score, #102 overall"
      },
      {
       "n": "66M",
       "l": "downloads a week, npm"
      },
      {
       "n": "23.3K",
       "l": "GitHub stars"
      },
      {
       "n": "181",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How chalk is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "126 projects, 3.8%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "71 projects, 2.9%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "67 projects, 2.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "47 projects, 14.1%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "30 projects, 6.3%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "20 projects, 7.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "15 projects, 3.2%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "8 projects, 5.7%",
       "v": "Kiro",
       "path": "agents/kiro/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 64.6% of its projects",
       "v": "Commander",
       "path": "tools/commander/"
      },
      {
       "l": "In 55.8% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 52.5% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 58.6% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 40.9% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 61.3% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 35.9% of its projects",
       "v": "ws",
       "path": "tools/ws/"
      },
      {
       "l": "In 35.4% of its projects",
       "v": "ora",
       "path": "tools/ora/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about chalk",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "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"
       ]
      },
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "chalk-logic: Create Chalk Logic concept-led chalkboard illustrations from briefs. Use for sparse wordless chalkboard explanations, non-diagram editorial"
       ]
      },
      {
       "title": "More in Dev workflow and config",
       "path": "tools/dev-workflow/",
       "items": [
        {
         "text": "dotenv",
         "path": "tools/dotenv/"
        },
        {
         "text": "Husky",
         "path": "tools/husky/"
        },
        {
         "text": "python-dotenv",
         "path": "tools/python-dotenv/"
        },
        {
         "text": "lint-staged",
         "path": "tools/lint-staged/"
        },
        {
         "text": "concurrently",
         "path": "tools/concurrently/"
        },
        {
         "text": "Rich",
         "path": "tools/rich/"
        },
        {
         "text": "Pydantic Settings",
         "path": "tools/pydantic-settings/"
        },
        {
         "text": "cross-env",
         "path": "tools/cross-env/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "chalk",
       "me": true,
       "facts": [
        "MIT",
        "Gid 80",
        "66M/wk"
       ]
      },
      {
       "name": "picocolors",
       "why": "Pick picocolors when you only need basic terminal colors and want the smallest possible package.",
       "path": "tools/picocolors/",
       "facts": []
      },
      {
       "name": "Rich",
       "why": "Pick Rich when your command-line program is written in Python; it also draws tables and progress bars.",
       "path": "tools/rich/",
       "facts": []
      },
      {
       "name": "boxen",
       "why": "Pick boxen when you want a framed box around a message, such as an update notice; it can sit next to chalk.",
       "path": "tools/boxen/",
       "facts": []
      }
     ],
     "more": "Compare chalk with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "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."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Install chalk in a project that runs on Node.js 22 or newer.",
       "code": "npm install chalk",
       "src": "https://github.com/chalk/chalk/releases/tag/v6.0.0"
      },
      {
       "text": "Import it and wrap the text you print. Styles chain, and you can nest them.",
       "code": "import chalk from 'chalk';\n\nconsole.log(chalk.blue('Hello world!'));\n",
       "src": "https://github.com/chalk/chalk/blob/main/readme.md"
      },
      {
       "text": "To force colors on or off without code changes, set FORCE_COLOR when you run the program.",
       "code": "FORCE_COLOR=0 node build.js",
       "src": "https://github.com/chalk/chalk/blob/main/readme.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "const chalk = require('chalk') in a CommonJS file or a TypeScript build that outputs CommonJS",
       "fix": "Use import chalk from 'chalk' in an ESM file, or pin chalk@4 if the setup cannot load ESM",
       "why": "chalk 5 and later ship only as ESM."
      },
      {
       "dont": "npm install chalk on a project that runs Node.js 18 or 20",
       "fix": "Run Node.js 22+, or pin chalk@5.6.2 on older Node.js",
       "why": "chalk 6.0.0 raised the minimum to Node.js 22 (package.json engines \"node\" \">=22\")."
      },
      {
       "dont": "chalk.level = 0 inside a library you publish",
       "fix": "const customChalk = new Chalk({level: 0}) and use that instance",
       "why": "The level property is shared by every chalk user in the same program."
      },
      {
       "dont": "A loose version range, or 5.6.1 kept in an old lockfile",
       "fix": "Pin an exact version (6.0.1) with a lockfile and remove 5.6.1 wherever it appears",
       "why": "5.6.1 was a harmful release pushed to the registry; 5.6.2 replaced it."
      },
      {
       "dont": "Expecting chalk.underlineRed('typo') to show a colored underline",
       "fix": "Add an underline style too, e.g. chalk.underlineRed.underlineCurly('typo')",
       "why": "Underline colors only show together with an underline style, and many terminals ignore them."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Can I load it with require() in an older CommonJS project?",
       "a": "Versions 5 and 6 are loaded with import. The readme suggests staying on chalk 4 if your TypeScript or build setup cannot handle that.",
       "evidence": {
        "url": "https://github.com/chalk/chalk/blob/main/readme.md",
        "quote": "If you want to use Chalk with TypeScript or a build tool, you will probably want to use Chalk 4 for now."
       }
      },
      {
       "q": "How do I turn colors off for a log file?",
       "a": "Set FORCE_COLOR=0 when you run the program, or create new Chalk({ level: 0 }) in your code.",
       "evidence": {
        "url": "https://github.com/chalk/chalk/blob/main/readme.md",
        "quote": "use the environment variable FORCE_COLOR=1 (level 1), FORCE_COLOR=2 (level 2), or FORCE_COLOR=3 (level 3) to forcefully enable color, or FORCE_COLOR=0 to forcefully disable."
       }
      },
      {
       "q": "Does it work in the browser?",
       "a": "Only in the developer console, which shows the color codes in Chrome since version 69. It does not style page text.",
       "evidence": {
        "url": "https://github.com/chalk/chalk/blob/main/readme.md",
        "quote": "Since Chrome 69, ANSI escape codes are natively supported in the developer console."
       }
      },
      {
       "q": "Does it pull in other packages?",
       "a": "No. The readme says chalk has no dependencies.",
       "evidence": {
        "url": "https://github.com/chalk/chalk/blob/main/readme.md",
        "quote": "Chalk has no dependencies."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm chalk"
  ],
  [
   "Category",
   "Dev workflow and config"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "80.0"
  ],
  [
   "Rank in category",
   "#9 of 299"
  ],
  [
   "GitHub",
   "chalk/chalk"
  ],
  [
   "Last change",
   "Oct 22, 2026"
  ]
 ],
 "good": [
  "Version 6 needs Node.js 22 or newer. On older Node.js, stay on version 5.6.2.",
  "Since version 5 it loads only with import. The readme suggests version 4 for setups that cannot handle that.",
  "Version 5.6.1 on the package registry was a hijacked, harmful release; 5.6.2 replaced it. Pin exact versions and keep a lockfile."
 ],
 "checked_line": "Read by AgentGid from 8 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/chalk.png"
}