blizzaga

command module
v0.0.0-...-b4f19e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 40 Imported by: 0

README

Blizzaga


Generate images of code and terminal output.

This fork of freeze adds the srcery theme and sets it as the default.

Examples

Blizzaga generates PNGs, SVGs, and WebPs of code and terminal output alike.

Generate an image of code
blizzaga artichoke.hs -o artichoke.png

output of blizzaga command, Haskell code block

Generate an image of terminal output

You can use blizzaga to capture ANSI output of a terminal command with the --execute flag.

blizzaga --execute "eza -lah"

output of blizzaga command, ANSI

Blizzaga is also super customizable and ships with an interactive TUI.

Installation

Install with Go:

go install github.com/starbaser/blizzaga@latest

Run with Nix:

nix run github:starbaser/blizzaga

From a local checkout:

nix run '.#'
go run .

Customization

Interactive mode

Blizzaga features a fully interactive mode for easy customization.

blizzaga --interactive
blizzaga interactive mode

Settings are written to $XDG_CONFIG/blizzaga/user.json and can be accessed with blizzaga --config user.

Flags

Screenshots can be customized with --flags or Configuration files.

[!NOTE] You can view all blizzaga customization with blizzaga --help.

Language

If possible, blizzaga auto-detects the language from the file name or analyzing the file contents. Override this inference with the --language flag.

cat artichoke.hs | blizzaga --language haskell

output of blizzaga command, Haskell code block
Theme

The default theme is srcery. Change the color theme with --theme; the original charm theme remains available.

blizzaga artichoke.hs --theme srcery

output of blizzaga command, Haskell code block with srcery theme
Output

Change the output file location, defaults to out.svg or stdout if piped. This value supports .svg, .png, .webp.

blizzaga main.go --output out.svg
blizzaga main.go --output out.png
blizzaga main.go --output out.webp

# or all of the above
blizzaga main.go --output out.{svg,png,webp}
Font

Specify the font family, font size, and font line height of the output image. Defaults to JetBrains Mono, 14(px), 1.2(em).

blizzaga artichoke.hs \
  --font.family "SF Mono" \
  --font.size 16 \
  --line-height 1.4

You can also embed a font file (in TTF, WOFF, or WOFF2 format) using the --font.file flag.

To use ligatures in the font, you can apply the --font.ligatures flag.

Line Numbers

Show line numbers in the terminal window with the --show-line-numbers flag.

blizzaga artichoke.hs --show-line-numbers

To capture only a specific range of line numbers you can use the --lines flag.

blizzaga artichoke.hs --show-line-numbers --lines 2,3
Border Radius

Add rounded corners to the terminal.

blizzaga artichoke.hs --border.radius 8

code screenshot with corner radius of 8px
Window

Add window controls to the terminal, macOS-style.

blizzaga artichoke.hs --window
output of blizzaga command, Haskell code block with window controls applied
Background

Set the background color of the terminal window.

blizzaga artichoke.hs --background "#121110"
Height

Set the height of the terminal window.

blizzaga artichoke.hs --height 400
Border Width

Add a border outline to the terminal window.

blizzaga artichoke.hs --border.width 1 --border.color "#515151" --border.radius 8

output of blizzaga command, Haskell code block with border applied
Padding

Add padding to the terminal window. You can provide 1, 2, or 4 values.

blizzaga main.go --padding 20          # all sides
blizzaga main.go --padding 20,40       # vertical, horizontal
blizzaga main.go --padding 20,60,20,40 # top, right, bottom, left

output of blizzaga command, Haskell code block with padding applied
Margin

Add margin to the terminal window. You can provide 1, 2, or 4 values.

blizzaga main.go --margin 20          # all sides
blizzaga main.go --margin 20,40       # vertical, horizontal
blizzaga main.go --margin 20,60,20,40 # top, right, bottom, left

output of blizzaga command, Haskell code block with margin applied
Shadow

Add a shadow under the terminal window.

blizzaga artichoke.hs --shadow.blur 20 --shadow.x 0 --shadow.y 10

output of blizzaga command, Haskell code block with a shadow

Screenshot TUIs

Use tmux capture-pane to generate screenshots of TUIs.

Run your TUI in tmux and get it to the state you want to capture. Next, use capture-pane to capture the pane and pipe that to blizzaga.

hx # in a separate pane
tmux capture-pane -pet 1 | blizzaga -c full
helix captured with blizzaga

Configuration

Blizzaga also supports configuration via a JSON file which can be passed with the --config / -c flag. In general, all --flag options map directly to keys and values in the config file

There are also some default configurations built into blizzaga which can be passed by name.

  • base: Simple screenshot of code.
  • full: macOS-like screenshot.
  • user: Uses ~/.config/blizzaga/user.json.

If you use --interactive mode, a configuration file will be created for you at ~/.config/blizzaga/user.json. This will be the default configuration file used in your screenshots.

blizzaga -c base main.go
blizzaga -c full main.go
blizzaga -c user main.go # alias for ~/.config/blizzaga/user.json
blizzaga -c ./custom.json main.go

Here’s what an example configuration looks like:

{
  "window": false,
  "theme": "srcery",
  "background": "#121110",
  "border": {
    "radius": 0,
    "width": 0,
    "color": "#504D47"
  },
  "shadow": false,
  "padding": [20, 40, 20, 20],
  "margin": "0",
  "font": {
    "family": "JetBrains Mono",
    "size": 14
  },
  "line_height": 1.2
}

Contributing

See contributing.

Feedback

Open issues and pull requests on GitHub.

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package font embeds the Iosevka Custom font assets used by Blizzaga.
Package font embeds the Iosevka Custom font assets used by Blizzaga.
Package render is the shared rendering core for blizzaga: it decorates a measured SVG content document with terminal-window chrome (background, padding/margin, window controls, shadow, border, corner radius) and rasterizes the result to PNG.
Package render is the shared rendering core for blizzaga: it decorates a measured SVG content document with terminal-window chrome (background, padding/margin, window controls, shadow, border, corner radius) and rasterizes the result to PNG.
test
input command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL