1---
2name: charm-freeze
3description: "Generate PNG, SVG, or WebP screenshots of code and terminal output with freeze. Use when screenshotting code, freeze, terminal-to-image, or capturing styled code snippets as images."
4---
5
6# charm-freeze
7
8Generate images of code and terminal output using `freeze`.
9
10## Basic Usage
11
12```bash
13# screenshot a file (auto-detects language)
14freeze main.go -o main.png
15
16# pipe code in
17cat artichoke.hs | freeze -o out.svg
18
19# capture live terminal command output
20freeze --execute "eza -lah" -o eza.png
21```
22
23## Output Formats
24
25Default output is `freeze.png`. Supports `.svg`, `.png`, `.webp`.
26
27```bash
28freeze main.go -o out.svg
29freeze main.go -o out.png
30freeze main.go -o out.webp
31
32# all at once
33freeze main.go -o out.{svg,png,webp}
34```
35
36If piped (e.g. `freeze main.go > out.svg`), outputs to stdout.
37
38## Language Detection
39
40Auto-detects from filename or content. Override with `--language`:
41
42```bash
43cat script.sh | freeze --language bash
44freeze file.txt --language python
45```
46
47## Themes
48
49```bash
50freeze main.go --theme dracula
51freeze main.go --theme charm # default
52freeze main.go --theme github
53```
54
55## Fonts
56
57Defaults: JetBrains Mono, 14px, 1.2 line-height.
58
59```bash
60freeze main.go \
61 --font.family "SF Mono" \
62 --font.size 16 \
63 --line-height 1.4
64
65# embed a font file (TTF, WOFF, WOFF2)
66freeze main.go --font.file ./FiraCode.ttf
67
68# enable ligatures
69freeze main.go --font.ligatures
70```
71
72## Decorations
73
74```bash
75# window controls (macOS style)
76freeze main.go --window
77
78# rounded corners
79freeze main.go --border.radius 8
80
81# border outline
82freeze main.go --border.width 1 --border.color "#515151" --border.radius 8
83
84# drop shadow
85freeze main.go --shadow.blur 20 --shadow.x 0 --shadow.y 10
86
87# background color
88freeze main.go --background "#08163f"
89```
90
91## Layout
92
93```bash
94# padding (1, 2, or 4 values)
95freeze main.go --padding 20
96freeze main.go --padding 20,40
97freeze main.go --padding 20,60,20,40 # top right bottom left
98
99# margin (same syntax)
100freeze main.go --margin 20,40
101
102# fixed height
103freeze main.go --height 400
104```
105
106## Line Numbers
107
108```bash
109freeze main.go --show-line-numbers
110
111# capture specific lines only
112freeze main.go --show-line-numbers --lines 10,25
113```
114
115## Configurations
116
117Three built-in presets:
118
119```bash
120freeze -c base main.go # minimal
121freeze -c full main.go # macOS-like, shadow + window controls
122freeze -c user main.go # your saved config (~/.config/freeze/user.json)
123
124# custom JSON config
125freeze -c ./custom.json main.go
126```
127
128Example `custom.json`:
129
130```json
131{
132 "window": true,
133 "border": { "radius": 8, "width": 1, "color": "#515151" },
134 "shadow": { "blur": 20, "x": 0, "y": 10 },
135 "padding": [20, 40, 20, 20],
136 "font": { "family": "JetBrains Mono", "size": 14 },
137 "line_height": 1.2
138}
139```
140
141## Interactive Mode
142
143```bash
144freeze --interactive
145```
146
147Opens a TUI to tweak all settings visually. Saves result to `~/.config/freeze/user.json`.
148
149## Screenshot TUIs
150
151Capture a running TUI via tmux:
152
153```bash
154tmux capture-pane -pet 1 | freeze -c full -o helix.png
155```
156
157## Wrap Long Lines
158
159```bash
160freeze main.go --wrap 80
161```