LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

chalk-cli

terminal string styling with colors and formatting

TLDR

Style text with color
$ chalk red "Hello World"
copy
Apply multiple styles
$ chalk red bold "Important text"
copy
Use template syntax
$ chalk -t "{red.bold Unicorns} are {blue fun}"
copy
Read from stdin
$ echo "text" | chalk --stdin green
copy
Negate a style in template
$ chalk -t "{red text {~red normal}}"
copy
Output without newline
$ chalk -n yellow "No newline"
copy
Demo all styles
$ chalk --demo
copy

SYNOPSIS

chalk [options] style... stringecho string | chalk --stdin style...

DESCRIPTION

chalk-cli is a command-line tool for styling terminal strings with colors and formatting. It wraps the popular Node.js Chalk library, providing access to its styling capabilities from shell scripts and the command line.Styles include foreground and background colors (standard and bright variants), as well as text modifiers like bold, dim, italic, underline, inverse, and strikethrough. Multiple styles can be combined, and the template syntax allows applying different styles to different parts of a single string.Input can come from command arguments or stdin, making it useful in shell pipelines for highlighting output or building colorful CLI interfaces.

PARAMETERS

-t, --template

Use template syntax for nested styles
--stdin
Read input from stdin
-n, --no-newline
Don't emit newline after output
--demo
Show demo of all available styles
-c, --color
Force color support

STYLES

Colors

black, red, green, yellow, blue, magenta, cyan, white, gray
Bright colors
redBright, greenBright, yellowBright, etc.
Background
bgRed, bgGreen, bgBlue, etc.
Modifiers
bold, dim, italic, underline, inverse, strikethrough

TEMPLATE SYNTAX

Templates allow inline nested styling:

$ {red.bold text}
{red red {~red normal}}  # ~ negates style
copy

INSTALLATION

$ npm install --global chalk-cli
copy

INSTALL

brew install chalk-cli
copy

CAVEATS

Requires Node.js. Color support depends on terminal capabilities. Use --color to force colors in pipes.

SEE ALSO

tput(1), printf(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid