# VHS

> Generate terminal GIFs from code scripts for testing and demonstrating CLI tools

Stars: 21.2k · Language: Go · License: MIT · Categories: Dev Tools

- Repository: https://github.com/charmbracelet/vhs
- Page: https://www.trmn.sh/tools/vhs

## Install

- Homebrew: `brew install vhs`
- Go: `go install github.com/charmbracelet/vhs@latest`
- Docker: `docker run --rm -v $PWD:/vhs ghcr.io/charmbracelet/vhs <cassette>.tape`

## Overview

VHS is a tool for generating terminal recordings as GIFs, MP4s, or WebMs from declarative script files called "tapes". Instead of manually recording terminal sessions, developers write tape files containing commands like `Type`, `Enter`, `Sleep`, and `Screenshot` to automate the creation of terminal demonstrations. The tool uses a virtual terminal to execute these commands and render the output to various formats.

Tape files use a simple syntax where you specify terminal dimensions, font settings, and a sequence of actions. For example, you can set the output format with `Output demo.gif`, configure the terminal with `Set FontSize 46`, simulate typing with `Type "echo 'Hello World'"`, and add pauses with `Sleep 500ms`. VHS supports advanced features like waiting for specific text patterns with regex, recording live terminal sessions to generate tape files, and publishing GIFs to a sharing service.

The tool is particularly useful for CLI tool developers who need consistent, reproducible demonstrations for documentation, integration testing, or marketing materials. VHS requires `ttyd` and `ffmpeg` as dependencies and can run locally or as a self-hosted SSH server, allowing remote access to generate recordings without installing dependencies on client machines. It supports multiple output formats including animated GIFs, MP4 videos, WebM files, and PNG frame sequences.

### Installation

```bash
# via Homebrew
brew install vhs
```

```bash
# via Go
go install github.com/charmbracelet/vhs@latest
```

```bash
# via Docker
docker run --rm -v $PWD:/vhs ghcr.io/charmbracelet/vhs <cassette>.tape
```

![VHS demo showing neofetch command execution](https://media.trmn.sh/cached/a9a12bf42b0b5732b14d06152d0a59bc5d157991066d56e40dda13494dfb1394.gif)

![Generated GIF showing echo command](https://media.trmn.sh/cached/a77aa405ac13d24f468b8b217b17d8dffb7b647cbfe4eafa81a67095823d05b3.gif)

## Alternatives

- [kubectx](https://www.trmn.sh/tools/kubectx.md): CLI tools to quickly switch between Kubernetes contexts and namespaces with fuzzy search support (Go, 20.1k stars)
- [sops](https://www.trmn.sh/tools/sops.md): Editor for encrypted files supporting YAML, JSON, ENV, INI formats with AWS KMS, GCP KMS, Azure Key Vault, age, and PGP encryption (Go, 23.6k stars)
- [asdf](https://www.trmn.sh/tools/asdf.md): Version manager that handles multiple language runtimes per project through plugins, using a single CLI and a .tool-versions file. (Go, 25.6k stars)
- [Task](https://www.trmn.sh/tools/go-task.md): Task runner and build tool that reads tasks from a YAML Taskfile, a simpler cross-platform alternative to Make. (Go, 16.3k stars)
- [TruffleHog](https://www.trmn.sh/tools/trufflehog.md): Secrets scanner that finds credentials in Git, filesystems, S3/GCS buckets and Docker images, classifies 800+ types, and verifies whether they are live. (Go, 28.8k stars)

---

Canonical: https://www.trmn.sh/tools/vhs
