CLI: Freeze — Generate images from the otuput of your terminal
Introduction
charm
If you have not heard about charm you should definitely check out what they have.
The libraries and apps they have created the best good looking ones I have seen in a long time, they somehow have reinvented the way cli tools look like on the terminal, and for better.
freeze
freeze is one of the new cli tools they have created to generate images of code and terminal output
Similar to asciinema but focus on images, you can generate an image from the terminal and customize it as you wish. It is really mind blowing how good the images look.
Install
MacOS
Using homebrew
brew install charmbracelet/tap/freeze
Linux
Any Linux platform using go
go install github.com/charmbracelet/freeze@latest
Use
Generate Image from STDOUT
freeze --execute "ls -la"
Generate image from a code file
TIP
It will detect the language automatically
freeze config.fish
If you prefer you can set the language
cat bash_script.sh | freeze --language bash
Customize
There are many options to customise the ouput on freeze
- margin, padding, window, width and height
- border: radius, width and color
- shadow: blur, x and y
- font: family, file, size and ligatures
- line-height, lines and show line numbers.
Interactive mode
The easiest way to customise freeze is by running the interactive mode
freeze --interactive bash_script.sh
# Changed
# Theme doom-one
Using flags
You can customise the output using flags too
freeze --theme doom-one bash_script.sh
Extras
Show line numbers
freeze --show-line-numbers bash_script.sh
Show only lines from X to Y
freeze --lines 2,5 --show-line-numbers bash_script.sh
Change the default freeze.png output file name and image type
TIP
You can generate svg, png or webp images
freeze bash_script.sh --output bash.svg