terminal-screenshot

Render ANSI-colored terminal output to PNG images for visual verification.

1.4k|216|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/daymade/claude-code-skills --skill terminal-screenshot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terminal-screenshot
Source: https://github.com/daymade/claude-code-skills/tree/main/daymade-claude-code/terminal-screenshot
Command: npx skills add https://github.com/daymade/claude-code-skills --skill terminal-screenshot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

When a CLI command's output arrives as plain text with raw ANSI escape codes, you cannot judge whether colors, contrast, alignment, or background blocks actually look right in a real terminal. This Skill captures full-fidelity colored output and renders it to a PNG image so the visual result can be inspected directly instead of guessing from hex values.

Core Features & Use Cases

  • ANSI-to-PNG rendering: Capture colored output from tools like delta, bat, eza, ripgrep, and git diff into an .ansi file, then render it to PNG via charmbracelet/freeze with a stdlib Python plus headless Chrome fallback.
  • Per-tool capture recipes: Provides exact commands to force full color output (--color=always, CLICOLOR_FORCE=1, script pty wrapping) for common CLI tools.
  • Background color matching: Renders against the real terminal background color so dark themes are judged under realistic contrast conditions.
  • Use Case: After editing delta colors in gitconfig, capture git diff | delta output, render it to PNG, and visually confirm the add/remove contrast is readable on your actual terminal background.

Quick Start

Capture the colored output of your CLI command to an .ansi file, then run scripts/render_ansi.sh with the input file, output PNG path, and your terminal background color, and read the resulting image.

Frequently Asked Questions about terminal-screenshot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render terminal ANSI output to a PNG image?

Capture the command's colored output to an .ansi file using forced color flags like --color=always, then run scripts/render_ansi.sh with the input file, output PNG path, and background color. It uses charmbracelet/freeze when available, otherwise a Python HTML converter plus headless Chrome.

How to verify delta or bat color themes visually?

Run the tool with colors forced, for example `git --no-pager diff | delta --dark --line-numbers > /tmp/x.ansi` or `bat --color=always file > /tmp/x.ansi`, then render the file to PNG and read the image. This shows the real rendered contrast instead of raw escape codes.

Why does my CLI output lose colors when piped or captured?

Most CLIs detect they are not writing to a real terminal and strip or downgrade colors. Force coloring with --color=always, CLICOLOR_FORCE=1, or by wrapping the command in a pty with `script -q /dev/null`.

Can I use freeze --execute to capture and render in one step?

No. Tools like delta and lazygit detect freeze's child pty as a reduced environment and silently drop background blocks and line numbers. Always capture output in a normal shell first, then render the saved file.

Does this work for full-screen TUI programs like lazygit or htop?

No. TUIs paint with cursor positioning rather than a linear ANSI stream, so they cannot be captured this way. Verify the underlying component instead, such as rendering `git diff | delta` for lazygit's diff colors.

Why does brew install freeze install the wrong tool?

The `freeze` Homebrew cask is an unrelated GUI app. Install the CLI via `brew install charmbracelet/tap/freeze` or `go install github.com/charmbracelet/freeze@latest`.