CLI tool for recording terminal GIFs as code
Top 2.8% on sourcepulse
VHS is a command-line tool that records terminal sessions and generates animated GIFs or other video formats, ideal for creating demos, tutorials, and integration tests for CLI applications. It allows users to script terminal interactions using a declarative .tape
file format, offering fine-grained control over typing, timing, and terminal appearance.
How It Works
VHS operates by simulating a terminal environment based on instructions within .tape
files. These files define actions like typing commands, pressing keys, pausing, and waiting for specific output patterns. The tool leverages ttyd
for terminal emulation and ffmpeg
for rendering the recorded sessions into video formats. This approach provides a reproducible and scriptable way to capture CLI behavior, ensuring consistency in demos and tests.
Quick Start & Requirements
brew
, Arch pacman
, Nix, Windows scoop
/winget
), Go (go install
), or Docker.ttyd
and ffmpeg
must be installed and in your PATH.vhs record > cassette.tape
vhs <cassette>.tape
Highlighted Details
record
command to generate .tape
files from live terminal sessions.serve
command for self-hosting VHS via SSH, enabling remote execution.Maintenance & Community
tree-sitter-vhs
for editors like Neovim.Licensing & Compatibility
Limitations & Caveats
The ttyd
and ffmpeg
dependencies must be correctly installed and accessible in the system's PATH. While VHS can record arbitrary terminal commands, complex TUI applications with heavy reliance on specific terminal capabilities might require careful scripting and testing.
2 weeks ago
1 day