# freeze

> Generate PNG, SVG, and WebP images of code and terminal output with syntax highlighting and customizable styling.

Stars: 4.9k · Language: Go · License: MIT · Categories: Dev Tools

- Repository: https://github.com/charmbracelet/freeze
- Page: https://www.trmn.sh/tools/freeze

## Install

- Homebrew: `brew install charmbracelet/tap/freeze`
- Go: `go install github.com/charmbracelet/freeze@latest`
- Arch Linux: `yay -S freeze`

## Overview

Freeze is a CLI tool that generates images of code and terminal output in PNG, SVG, and WebP formats. It supports syntax highlighting for various programming languages with auto-detection based on file extensions or content analysis. Users can capture static code files or execute terminal commands with the `--execute` flag to generate images of ANSI output.

The tool includes an interactive TUI mode for configuration and extensive customization options. Users can modify themes, fonts, window styling, borders, shadows, padding, margins, and line numbers. It supports embedding custom font files and offers preset configurations like 'base', 'full', and user-defined configs stored in `~/.config/freeze/user.json`.

Freeze integrates with tmux for capturing TUI applications using `tmux capture-pane`. Configuration can be managed through JSON files or command-line flags, with all styling options available through both methods. The tool is particularly useful for developers creating documentation, tutorials, or sharing code snippets with consistent visual formatting.

### Installation

```bash
# via Homebrew
brew install charmbracelet/tap/freeze
```

```bash
# via Go
go install github.com/charmbracelet/freeze@latest
```

```bash
# via Arch Linux
yay -S freeze
```

![Freeze code screenshot generation](https://media.trmn.sh/cached/5603fe9378cede57e7d7ab9772b5fac1bc10bbf4ad6c14102e488cc26aa2b425.gif)

![freeze interactive mode](https://media.trmn.sh/cached/c0a11f5214f0cf8fc42b158a55d040d797be4583f92ea571eabafa3a4fc5e82a.gif)

## Alternatives

- [Docker CLI](https://www.trmn.sh/tools/docker-cli.md): Source repository for the Docker command-line client, written in Go and built with docker buildx bake, with cross-platform and glibc/musl build targets. (Go, 6.1k stars)
- [Popeye](https://www.trmn.sh/tools/popeye.md): Read-only scanner that lints live Kubernetes clusters for misconfigurations, unused resources, and over/under allocation, with console, JSON, and HTML reports. (Go, 6.5k stars)
- [Krew](https://www.trmn.sh/tools/krew.md): Package manager for kubectl plugins: discover, install, and manage plugins from a central index, similar to apt, dnf, or brew. (Go, 7.0k stars)
- [nap](https://www.trmn.sh/tools/nap.md): Code snippet manager with CLI and TUI for creating, organizing, and accessing snippets in the terminal (Go, 2.2k stars)
- [flyctl](https://www.trmn.sh/tools/flyctl.md): Command-line interface for fly.io that authenticates accounts, lists apps, and checks app status; also invoked as fly. (Go, 1.7k stars)

---

Canonical: https://www.trmn.sh/tools/freeze
