How to use standard input/output
By default, Whiskers:
- Takes in a template via standard input.
- Renders the template.
- Outputs the template to standard output.
Let’s walk through those steps to get a better understanding:
-
Execute the following command in your terminal:
Terminal window $ whiskers - -
The terminal is now waiting for standard input, let’s get the value of Catppuccin Mocha Red as a hex code by typing the highlighted text:
Terminal window $ whiskers -Catppuccin Mocha Red - {{flavors.mocha.colors.red.hex}} -
Now press
Ctrl-D
to send an EOF signal, and allow Whiskers to render and output. Your terminal should now look like this:Terminal window $ whiskers -Catppuccin Mocha Red - {{flavors.mocha.colors.red.hex}}Catppuccin Mocha Red - f38ba8 -
Well done! You’ve just used Whiskers via standard input/output.