← 返回首页
GitHub - chalk/chalk-cli: Terminal string styling done right · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

chalk/chalk-cli

Go to file
Code

Repository files navigation

More items

chalk-cli

Terminal string styling done right

Install

npm install --global chalk-cli

Usage

$ chalk --help Usage $ chalk <style> ... <string> $ echo <string> | chalk <style> ... Options --template, -t Style template. The `~` character negates the style. --stdin Read input from stdin rather than from arguments. --no-newline, -n Don't emit a newline (`\n`) after the input. --demo Demo of all Chalk styles. --color, -c Force color support. Examples $ chalk red bold 'Unicorns & Rainbows' $ chalk -t '{red.bold Unicorns & Rainbows}' $ chalk -t '{red.bold Dungeons and Dragons {~bold.blue (with added fairies)}}' $ echo 'Unicorns from stdin' | chalk --stdin red bold

See supported styles.

Template syntax

  • {red.bold unicorn}
  • {red.bold unicorns} are {blue FUN!!!}
  • {red.bold unicorn {blue.underline dancing}}
  • {red red {~red normal}}
  • {red hey\} still red} not red
  • {red hey\\} not red

Related

  • chalk - API for this package

Maintainers

About

Terminal string styling done right

Resources

License

Stars

297 stars

Watchers

8 watching

Forks

Sponsor this project

  •  
  •  

Packages

 
 
 

Contributors

Footer

© 2026 GitHub, Inc.