VHS
A command-line recorder that turns scripted terminal sessions into GIF, MP4, WebM, or PNG output.
Why consider VHS?
Write terminal GIFs as code for integration testing and demoing CLI tools.
Learn VHS by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide3 sections
Introduction to VHS
VHS allows users to generate terminal GIFs programmatically using code. Instead of manually recording a screen and hoping for no typos, you write a script that defines what should happen in a virtual terminal. This approach is highly reproducible and especially useful for integration testing or demoing CLI tools in documentation.
Prerequisites and Installation
To run VHS, users must have ttyd and ffmpeg installed on their system, as these dependencies handle the terminal emulation and video rendering. Once those are in your $PATH, you can install VHS through various package managers.
For instance, on macOS or Linux, you can use Homebrew with brew install vhs. You can refer to the official repository for other installation methods.
Creating and Running a Tape
A .tape file contains a sequence of instructions such as typing commands, pressing keys, or waiting. These commands tell the VHS virtual terminal exactly what to execute, how fast to type, and when to pause.
Users can start a new project by generating a blank tape file using the vhs new command:
vhs new demo.tapeOnce the tape file is generated, you can open it in your preferred text editor. Inside, you can specify settings like Set FontSize 46 or Set Width 1200, followed by interaction commands like Type or Sleep.
For example, a simple script might look like this:
# Where should we write the GIF?Output demo.gif# Set up a 1200x600 terminal with 46px font.Set FontSize 46Set Width 1200Set Height 600# Type a command in the terminal.Type "echo 'Welcome to VHS!'"# Pause for dramatic effect...Sleep 500ms# Run the command by pressing enter.Enter# Admire the output for a bit.Sleep 5sAfter finalizing your script, you feed it back into VHS to produce the GIF:
vhs demo.tapeAdvanced Recording Features
Sometimes writing out a script manually can be tedious. VHS can record terminal actions directly into a tape file for later editing. By running the record command, VHS captures your live keystrokes and timing:
vhs record > cassette.tapeOnce finished, you can open cassette.tape to tweak the timings or fix any mistakes before rendering the final output.
In addition, developers can hide setup and cleanup steps from the final rendering. The Hide command instructs VHS to stop capturing frames. It's useful to pause a recording to perform hidden commands. This is particularly handy for compiling binaries or authenticating before the visible demonstration begins. You can resume recording frames by running Show.
When you're ready to share your creation, VHS includes a publish feature:
vhs publish demo.gifThis uploads the GIF to Charm's servers and provides a shareable URL, making it easy to embed in pull requests or markdown files.
Related tools
More options with a similar category or technology profile.
MyPaint
Nimble, distraction-free, and easy graphic application for digital painters.
Pencil2D
Easy, intuitive traditional hand-drawn 2D animation software across raster and vector.
Hydrogen
Advanced open-source drum machine and pattern-based step sequencer for audio production.
Pure Data
Open source visual programming language for multimedia, audio, and physical computing.