TiloBox
Back to directory
VHS project preview

VHS

A command-line recorder that turns scripted terminal sessions into GIF, MP4, WebM, or PNG output.

LicenseMIT
GitHub stars20.7k
Last commit2 weeks ago
Tags6 topics
CliGoOpen SourceSecurityGifTerminal Recording
Overview

Why consider VHS?

Write terminal GIFs as code for integration testing and demoing CLI tools.

Guided learning

Learn VHS by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

3 min read 3 sections
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:

sh
1vhs new demo.tape

Once 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:

elixir
1# Where should we write the GIF?
2Output demo.gif
3
4# Set up a 1200x600 terminal with 46px font.
5Set FontSize 46
6Set Width 1200
7Set Height 600
8
9# Type a command in the terminal.
10Type "echo 'Welcome to VHS!'"
11
12# Pause for dramatic effect...
13Sleep 500ms
14
15# Run the command by pressing enter.
16Enter
17
18# Admire the output for a bit.
19Sleep 5s

After finalizing your script, you feed it back into VHS to produce the GIF:

sh
1vhs demo.tape

Advanced 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:

bash
1vhs record > cassette.tape

Once 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:

bash
1vhs publish demo.gif

This 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.

VHS FAQs

VHS is listed as a Media tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

VHS is listed under the MIT license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

VHS is listed as an alternative to Asciinema. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.