Skip to content

sylvaindethier/chalk.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖍️💻 chalk.sh Build Status

Terminal string styling done right -- with bash

Install

Get a local copy by either:

  • Add as submodule:
      $ git submodule add https://github.com/sylvaindethier/chalk.sh.git
  • Clone:
      $ git clone https://github.com/sylvaindethier/chalk.sh.git
  • Download the ZIP archive and unzip

Then source the chalk.sh/cli.sh script:

$ source path/to/chalk.sh/cli.sh

Usage

chalk.sh provides exactly the same CLI usage as chalk-cli

Make sure to source the chalk.sh/cli.sh script before running chalk

$ chalk --help

  Usage
    $ chalk <style> ... <string>
    $ echo <string> | chalk <style> ...

  Options
    --template, -t  Style template. The `~` character negates the style.

  Examples
    $ chalk red bold 'Unicorns & Rainbows'
    $ chalk -t '{red.bold Unicorns & Rainbows}'
    $ chalk -t '{red.bold Dungeons and Dragons {~bold.blue (with added fairies)}}'

See chalk 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-cli - Original chalk CLI (NodeJS)
  • chalk - Original chalk (NodeJS)

License

MIT