# Freeze renders code and terminal output as images

> Freeze is a Charm command-line tool that turns source code and terminal output into PNG, SVG, and WebP images, with live capture and deep styling.

**charmbracelet/freeze** — Generate images of code and terminal output 📸

- Repository: https://github.com/charmbracelet/freeze
- Stars: 4,864 · Forks: 107
- Language: Go
- License: MIT
- Published: 2026-09-23 · Updated: 2026-09-23 · Language: en
- Canonical page: https://hysenlabs.com/projects/charmbracelet-freeze

## Freeze turns code and terminal output into images

Freeze is a command-line tool from Charm that generates images of code and terminal output. It produces PNG, SVG, and WebP files from source files or from a terminal session, which makes it useful for sharing snippets in documentation, blog posts, and slides. The project describes itself as super customizable and notes that it ships with an interactive terminal user interface. Freeze is part of the Charm ecosystem of terminal tools. Because the output is a static image rather than a live shell, the result is easy to embed anywhere an image works. The tool focuses on rendering what code and terminal output look like, not on modifying the code it renders, so the source stays untouched. A single command is enough to go from a file on disk to a finished picture, which keeps the step between writing code and showing it short.

## Generating an image of source code

To make an image of a source file, you pass the file to freeze and choose an output name. Freeze renders the file as a framed screenshot and writes the result to the path you give. The example below creates a PNG named artichoke.png from a Haskell source file. You can pick the output format through the file extension, and defaults fall back to out.svg or to standard output when the command is piped into another program.

```sh
freeze artichoke.hs -o artichoke.png
```

## Capturing live terminal output with --execute

Freeze can also capture the ANSI output of a running terminal command rather than a static file. The --execute flag tells freeze to run the command and render whatever it prints, including color and styling, as an image. This is handy for showing the real look of a command-line tool's output in a screenshot. The example captures the output of the eza listing command, preserving its colors in the resulting image so readers see the same presentation a terminal user would.

```bash
freeze --execute "eza -lah"
```

## Installation options for Freeze

Freeze is distributed as a Go program and can be installed in several ways. On macOS or Linux you can use Homebrew through the charmbracelet tap, on Arch Linux through an AUR helper such as yay, and on Nix through nix-env. Prebuilt packages in Debian and RPM formats and binaries for Linux, macOS, and Windows are published on the releases page. You can also install it directly with the go tool, which fetches the latest version from the module proxy. These choices cover both system package managers and a quick per-user install without administrator rights.

```sh
go install github.com/charmbracelet/freeze@latest
```

## Customization through flags and an interactive TUI

Beyond basic rendering, Freeze supports a wide set of customization flags. You can set the background color, margin, padding, border radius, window controls, theme, and height, plus font family, size, and line height. Line numbers can be shown, and a specific range of lines can be captured with --lines. Freeze tries to auto-detect the language from the file name or contents, and you can override that with --language. A fully interactive mode walks through these settings without editing flags by hand. The first example starts the interactive session, and the second applies the dracula theme to a Haskell file. Settings chosen interactively are saved to a JSON file, so the same look can be reused for later screenshots without re-entering every option each time.

```bash
freeze --interactive
```

```bash
freeze artichoke.hs --theme dracula
```

## Configuration files and offline screenshots

All of the flag options also map to keys in a JSON configuration file passed with --config or -c. Freeze ships a few named configurations, including base for a simple screenshot, full for a macOS-like screenshot, and user for the file written by interactive mode at ~/.config/freeze/user.json. There is also a workflow for capturing terminal UI programs: by running the TUI inside tmux and piping tmux capture-pane into freeze, you can snapshot a live TUI. This makes Freeze useful for both static code and interactive terminal apps, and it keeps settings repeatable across many screenshots.

## License and project home

Freeze is released under the MIT license and is part of Charm, a project that builds open-source terminal software. Feedback is collected through the project's Twitter, Fediverse, and Discord channels, and contributions are welcomed through the project's contributing guide. As a focused single-purpose tool, it complements other Charm utilities by turning their text output into shareable images that look consistent across posts and documents, without pulling in a heavy rendering stack.

## Conclusion

Freeze is a Charm command-line utility that renders code and terminal output into PNG, SVG, and WebP images, with support for live capture through --execute and deep styling through flags or a JSON config. It installs through package managers, prebuilt binaries, or go install, and an interactive mode lowers the barrier to customizing screenshots. Released under the MIT license, it fits developers and writers who need clean, consistent images of command-line and code content for docs and presentations.

## FAQ

### What image formats does Freeze support?

Freeze generates PNG, SVG, and WebP images of code and terminal output. The output flag accepts .svg, .png, and .webp extensions, and defaults to out.svg or to standard output when the command is piped.

### Can Freeze capture a running terminal command?

Yes. The --execute flag runs a terminal command and renders its ANSI output as an image, which preserves color and styling from the live session.

### How do I install Freeze?

Freeze can be installed with Homebrew on macOS or Linux, via yay on Arch Linux, through Nix with nix-env, by downloading Debian, RPM, or binary packages from the releases page, or with go install github.com/charmbracelet/freeze@latest.

## Sources

- [charmbracelet/freeze on GitHub](https://github.com/charmbracelet/freeze)
- [Issues](https://github.com/charmbracelet/freeze/issues)
- [License: MIT](https://github.com/charmbracelet/freeze/blob/main/LICENSE)
- [README](https://github.com/charmbracelet/freeze/blob/main/README.md)
- [Releases](https://github.com/charmbracelet/freeze/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/charmbracelet-freeze
