File: README.md
VHS
Write terminal GIFs as code for integration testing and demoing your CLI tools.
The above example was generated with VHS (view source).
Tutorial
To get started, install VHS and create a new .tape file.
vhs new demo.tapeOpen the .tape file with your favorite $EDITOR.
vim demo.tapeTape files consist of a series of commands. The commands are
instructions for VHS to perform on its virtual terminal. For a list of all
possible commands see the command reference.
# Where should we write the GIF?
Output demo.gif
# Set up a 1200x600 terminal with 46px font.
Set FontSize 46
Set Width 1200
Set 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 5sOnce you've finished, save the file and feed it into VHS.
vhs demo.tapeAll done! You should see a new file called demo.gif (or whatever you named
the Output) in the directory.
For more examples see the examples/ directory.
Installation
[!NOTE]
VHS requiresttydandffmpegto be installed and available on yourPATH.
Use a package manager:
# macOS or Linux
brew install vhs
# Arch Linux (btw)
pacman -S vhs
# Nix
nix-env -iA nixpkgs.vhs
# Windows using scoop
scoop install vhsOr, use Docker to run VHS directly, dependencies included:
docker run --rm -v $PWD:/vhs ghcr.io/charmbracelet/vhs <cassette>.tapeOr, download it:
- Packages are available in Debian and RPM formats
- Binaries are available for Linux, macOS, and Windows
Or, just install it with go:
go install github.com/charmbracelet/vhs@latestWindows, Debian, Ubuntu, Fedora, RHEL, Void Instructions
- Debian / Ubuntu
# Debian/Ubuntu
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
# Install ttyd from https://github.com/tsl0922/ttyd/releases
sudo apt update && sudo apt install vhs ffmpeg- Fedora / RHEL
echo '[charm]
name=Charm
baseurl=https://repo.charm.sh/yum/
enabled=1
gpgcheck=1
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
# Install ttyd from https://github.com/tsl0922/ttyd/releases
sudo yum install vhs ffmpeg- Void
sudo xbps-install vhs- Windows
winget install charmbracelet.vhs
# or scoop
scoop install vhsRecord Tapes
VHS has the ability to generate tape files from your terminal actions!
To record to a tape file, run:
vhs record > cassette.tapePerform any actions you want and then exit the terminal session to stop
recording. You may want to manually edit the generated .tape file to add
settings or modify actions. Then, you can generate the GIF:
vhs cassette.tapePublish Tapes
VHS allows you to publish your GIFs to our servers for easy sharing with your
friends and colleagues. Specify which file you want to share, then use thepublish sub-command to host it on vhs.charm.sh. The output will provide you
with links to share your GIF via browser, HTML, and Markdown.
vhs publish demo.gifThe VHS Server
VHS has an SSH server built in! When you self-host VHS you can access it as
though it were installed locally. VHS will have access to commands and
applications on the host, so you don't need to install them on your machine.
To start the server run:
vhs serveConfiguration Options
VHS_PORT: The port to listen on (1976)VHS_HOST: The host to listen on (localhost)VHS_GID: The Group ID to run the server as (current user's GID)VHS_UID: The User ID to run the server as (current user's UID)VHS_KEY_PATH: The path to the SSH key to use (.ssh/vhs_ed25519)VHS_AUTHORIZED_KEYS_PATH: The path to the authorized keys file (empty, publicly accessible)
Then, simply access VHS from a different machine via ssh:
ssh vhs.example.com < demo.tape > demo.gifVHS Command Reference
[!NOTE]
You can view all VHS documentation on the command line withvhs manual.
There are a few basic types of VHS commands:
Output: specify file outputRequire: specify required programs for tape fileSet <Setting> Value: set recording settingsType "<characters>": emulate typingLeftRightUpDown: arrow keysBackspaceEnterTabSpace: special keysScrollUpScrollDown: scroll terminal viewportCtrl[+Alt][+Shift]+<char>: press control + key and/or modifierSleep <time>: wait for a certain amount of timeWait[+Screen][+Line] /regex/: wait for specific conditionsHide: hide commands from outputShow: stop hiding commands from outputScreenshot: screenshot the current frameCopy/Paste: copy and paste text from clipboard.Source: source commands from another tapeEnv <Key> Value: set environment variables
Output
The Output command allows you to specify the location and file format
of the render. You can specify more than one output in a tape file which
will render them to the respective locations.
Output out.gif
Output out.mp4
Output out.webm
Output frames/ # a directory of frames as a PNG sequenceRequire
The Require command allows you to specify dependencies for your tape file.
These are useful to fail early if a required program is missing from the$PATH, and it is certain that the VHS execution will not work as expected.
Require commands must be defined at the top of a tape file, before any non-
setting or non-output command.
# A tape file that requires gum and glow to be in the $PATH
Require gum
Require glowSettings
The Set command allows you to change global aspects of the terminal, such as
the font settings, window dimensions, and GIF output location.
Setting must be administered at the top of the tape file. Any setting (exceptTypingSpeed) applied after a non-setting or non-output command will be
ignored.
Set Shell
Set the shell with the Set Shell <shell> command
Set Shell fishSet Font Size
Set the font size with the Set FontSize <number> command.
Set FontSize 10
Set FontSize 20
Set FontSize 40Set Font Family
Set the font family with the Set FontFamily "" command
Set FontFamily "Monoflow"Set Width
Set the width of the terminal with the Set Width command.
Set Width 300Set Height
Set the height of the terminal with the Set Height command.
Set Height 1000Set Letter Spacing
Set the spacing between letters (tracking) with the Set LetterSpacing
Command.
Set LetterSpacing 20Set Line Height
Set the spacing between lines with the Set LineHeight Command.
Set LineHeight 1.8Set Typing Speed
Set TypingSpeed 500ms # 500ms
Set TypingSpeed 1s # 1sSet the typing speed of seconds per key press. For example, a typing speed of0.1 would result in a 0.1s (100ms) delay between each character being typed.
This setting can also be overwritten per command with the @<time> syntax.
Set TypingSpeed 0.1
Type "100ms delay per character"
Type@500ms "500ms delay per character"Set Theme
Set the theme of the terminal with the Set Theme command. The theme value
should be a JSON string with the base 16 colors and foreground + background.
Set Theme { "name": "Whimsy", "black": "#535178", "red": "#ef6487", "green": "#5eca89", "yellow": "#fdd877", "blue": "#65aef7", "magenta": "#aa7ff0", "cyan": "#43c1be", "white": "#ffffff", "brightBlack": "#535178", "brightRed": "#ef6487", "brightGreen": "#5eca89", "brightYellow": "#fdd877", "brightBlue": "#65aef7", "brightMagenta": "#aa7ff0", "brightCyan": "#43c1be", "brightWhite": "#ffffff", "background": "#29283b", "foreground": "#b3b0d6", "selection": "#3d3c58", "cursor": "#b3b0d6" }You can also set themes by name:
Set Theme "Catppuccin Frappe"See the full list by running vhs themes, or in THEMES.md.
Set Padding
Set the padding (in pixels) of the terminal frame with the Set Padding
command.
Set Padding 0Set Margin
Set the margin (in pixels) of the video with the Set Margin command.
Set Margin 60
Set MarginFill "#6B50FF"Set Window Bar
Set the type of window bar (Colorful, ColorfulRight, Rings, RingsRight) on the terminal window with the Set WindowBar command.
Set WindowBar ColorfulSet Border Radius
Set the border radius (in pixels) of the terminal window with the Set BorderRadius command.
# You'll likely want to add a Margin + MarginFill if you use BorderRadius.
Set Margin 20
Set MarginFill "#674EFF"
Set BorderRadius 10Set Framerate
Set the rate at which VHS captures frames with the Set Framerate command.
Set Framerate 60Set Playback Speed
Set the playback speed of the final render.
Set PlaybackSpeed 0.5 # Make output 2 times slower
Set PlaybackSpeed 1.0 # Keep output at normal speed (default)
Set PlaybackSpeed 2.0 # Make output 2 times fasterSet Loop Offset
Set the offset for when the GIF loop should begin. This allows you to make the
first frame of the GIF (generally used for previews) more interesting.
Set LoopOffset 5 # Start the GIF at the 5th frame
Set LoopOffset 50% # Start the GIF halfway throughSet Cursor Blink
Set whether the cursor should blink. Enabled by default.
Set CursorBlink falseType
Use Type to emulate key presses. That is, you can use Type to script typing
in a terminal. Type is handy for both entering commands and interacting with
prompts and TUIs in the terminal. The command takes a string argument of the
characters to type.
You can set the standard typing speed with Set TypingSpeed
and override it in places with a @time argument.
# Type something
Type "Whatever you want"
# Type something really slowly!
Type@500ms "Slow down there, partner."Escape single and double quotes with backticks.
Type `VAR="Escaped"`Keys
Key commands take an optional @time and optional repeat count for repeating
the key press every interval of <time>.
Key[@<time>] [count]Backspace
Press the backspace key with the Backspace command.
Backspace 18Ctrl
You can access the control modifier and send control sequences with the Ctrl
command.
Ctrl+REnter
Press the enter key with the Enter command.
Enter 2Arrow Keys
Press any of the arrow keys with the Up, Down, Left, Right commands.
Up 2
Down 2
Left
Right
Left
Right
Type "B"
Type "A"Tab
Enter a tab with the Tab command.
Tab@500ms 2Space
Press the space bar with the Space command.
Space 10Page Up / Down
Press the Page Up / Down keys with the PageUp or PageDown commands.
PageUp 3
PageDown 5Scroll Up / Down
Scroll the terminal viewport directly with ScrollUp and ScrollDown.
Both commands use the same optional @time and repeat count shape as other
repeatable key commands: ScrollUp[@<time>] [count].
ScrollUp 10
ScrollDown 4
ScrollDown@100ms 12Wait
The Wait command allows you to wait for something to appear on the screen.
This is useful when you need to wait on something to complete, even if you don't
know how long it'll take, while including it in the recording like a spinner or
loading state.
The command takes a regular expression as an argument, and optionally allows you
to set the duration to wait and if you want to check the whole screen or just the
last line (the scope).
Wait
Wait /World/
Wait+Screen /World/
Wait+Line /World/
Wait@10ms /World/
Wait+Line@10ms /World/The default regular expression is />$/, the wait timeout is 15s, and the
default scope is Line.
Sleep
The Sleep command allows you to continue capturing frames without interacting
with the terminal. This is useful when you need to wait on something to
complete while including it in the recording like a spinner or loading state.
The command takes a number argument in seconds.
Sleep 0.5 # 500ms
Sleep 2 # 2s
Sleep 100ms # 100ms
Sleep 1s # 1sHide
The Hide command instructs VHS to stop capturing frames. It's useful to pause
a recording to perform hidden commands.
HideThis command is helpful for performing any setup and cleanup required to record
a GIF, such as building the latest version of a binary and removing the binary
once the demo is recorded.
Output example.gif
# Setup
Hide
Type "go build -o example . && clear"
Enter
Show
# Recording...
Type 'Running ./example'
...
Enter
# Cleanup
Hide
Type 'rm example'
EnterShow
The Show command instructs VHS to begin capturing frames, again. It's useful
after a Hide command to resume frame recording for the output.
Hide
Type "You won't see this being typed."
Show
Type "You will see this being typed."Screenshot
The Screenshot command captures the current frame (png format).
# At any point...
Screenshot examples/screenshot.pngCopy / Paste
The Copy and Paste copy and paste the string from clipboard.
Copy "https://github.com/charmbracelet"
Type "open "
Sleep 500ms
PasteEnv
Env command sets the environment variable via key-value pair.
Env HELLO "WORLD"
Type "echo $HELLO"
Enter
Sleep 1sSource
The source command allows you to execute commands from another tape.
Source config.tapeContinuous Integration
You can hook up VHS to your CI pipeline to keep your GIFs up-to-date with
the official VHS GitHub Action:
VHS can also be used for integration testing. Use the .txt or .ascii output
to generate golden files. Store these files in a git repository to ensure there
are no diffs between runs of the tape file.
Output golden.asciiSyntax Highlighting
Thereโs a tree-sitter grammar for .tape files available for editors that
support syntax highlighting with tree-sitter:
It works great with Neovim, Emacs, and so on!
Contributing
See contributing.
Feedback
Weโd love to hear your thoughts on this project. Feel free to drop us a note!
License
Part of Charm.
Charm็ญ็ฑๅผๆบ โข Charm loves open source
File: examples/commands/README.md
Commands
Arrow
Output examples/commands/arrow.gif
Set FontSize 42
Set Height 225
Type "Navigate around"
Sleep .25
Left 10
Sleep 1
Right@50ms 10
Sleep 1Backspace
Output examples/commands/backspace.gif
Set FontSize 42
Set Height 225
Type@50ms "Delete anything..."
Backspace 18
Sleep 1Comment
Output examples/commands/comment.gif
Set Height 500
Set Width 1000
# This is a comment.
# These are ignored by the parser so you can write whatever you want!
# Quickly comment out a command you don't need.
# Type "Hello, world!"
Sleep 1Ctrl
Output examples/commands/ctrl.gif
Set FontSize 42
Set Height 225
Sleep 1
Ctrl+R
Sleep 1Enter
Output examples/commands/enter.gif
Set FontSize 42
Set Height 350
Sleep 1
[email protected] 2
Sleep 1Hide
Output examples/commands/hide.gif
Set FontSize 42
Set Height 300
Hide
Type "You won't see this being typed." Ctrl+C
Show
Type "You will see this being typed."
Sleep 2Show
Output examples/commands/show.gif
Hide
Type "export HIDDEN=wow"
Enter
Ctrl+L
Show
Type "echo $HIDDEN"
Enter
Sleep 1Space
Output examples/commands/space.gif
Set FontSize 42
Set Height 225
Sleep .25
Space 10
Sleep 1Tab
Output examples/commands/tab.gif
Set FontSize 42
Set Height 300
Type "cd ."
Sleep 0.5s
[email protected] 2
Sleep 1sType
Output examples/commands/type.gif
Set FontSize 42
Set Height 225
Sleep 1
# Type something
Type "Whatever you want"
Sleep 1 Ctrl+U Sleep 1
# Type something really slowly!
Type@500ms "Slow down there, partner."
Sleep 1File: examples/cli-ui/README.md
CLI UI
Format
Output examples/cli-ui/format.gif
Set FontSize 32
Set Width 2200
Set Height 400
Hide
Type "irb --noautocomplete"
Enter
Type "require 'cli/ui'"
Enter
Type "CLI::UI::StdoutRouter.enable"
Enter
Ctrl+L
Show
Type 'puts CLI::UI.fmt "{{red:Red}} {{green:Green}}"'
Sleep .5
Enter
Sleep 5Nested Frames
Output examples/cli-ui/nested-frames.gif
Set FontSize 32
Set Width 2000
Set Height 750
Hide
Type "irb --noautocomplete"
Enter
Type "require 'cli/ui'"
Enter
Type "CLI::UI::StdoutRouter.enable"
Enter
Ctrl+L
Show
Type "CLI::UI::Frame.open('Frame 1') do"
Enter
Type " CLI::UI::Frame.open('Frame 2') { puts 'inside frame 2' }"
Enter
Type " puts 'inside frame 1'"
Enter
Type "end"
Sleep 1
Enter
Sleep 3Progress
Output examples/cli-ui/progress.gif
Set FontSize 32
Set Width 2200
Set Height 400
Hide
Type "irb --noautocomplete"
Enter
Type "require 'cli/ui'"
Enter
Type "CLI::UI::StdoutRouter.enable"
Enter
Ctrl+L
Show
Type "CLI::UI::Progress.progress { |bar| 100.times { sleep 0.02; bar.tick } }"
Sleep .5
Enter
Sleep 5Spinner
Output examples/cli-ui/spinner.gif
Set FontSize 32
Set Width 2200
Set Height 400
Hide
Type "irb --noautocomplete"
Enter
Type "require 'cli/ui'"
Enter
Type "CLI::UI::StdoutRouter.enable"
Enter
Ctrl+L
Show
Type "CLI::UI::Spinner.spin('Spinning...') { sleep 3 }"
Sleep .5
Enter
Sleep 5Status Widget
Output examples/cli-ui/status-widget.gif
Set FontSize 32
Set Width 2200
Set Height 400
Hide
Type "irb --noautocomplete"
Enter
Type "require 'cli/ui'"
Enter
Type "CLI::UI::StdoutRouter.enable"
Enter
Ctrl+L
Show
Type 'CLI::UI::Spinner.spin("Building: {{@widget/status:1:2:3:4}}") { |spinner| sleep 3 }'
Sleep .5
Enter
Sleep 5Symbols
Output examples/cli-ui/symbols.gif
Set FontSize 32
Set Width 2200
Set Height 400
Hide
Type "irb --noautocomplete"
Enter
Type "require 'cli/ui'"
Enter
Type "CLI::UI::StdoutRouter.enable"
Enter
Ctrl+L
Show
Type 'puts CLI::UI.fmt "{{*}} {{v}} {{?}} {{x}}"'
Sleep .5
Enter
Sleep 5Text Prompt
Output examples/cli-ui/text-prompt.ascii
Output examples/cli-ui/text-prompt.gif
Set FontSize 32
Set Width 2200
Set Height 500
Hide
Type "irb --noautocomplete"
Enter
Type "require 'cli/ui'"
Enter
Type "CLI::UI::StdoutRouter.enable"
Enter
Ctrl+L
Show
Type "CLI::UI.ask('Is CLI UI Awesome?', default: 'It is great!')"
Sleep .5
Enter
Sleep 1
Type "I love it!"
Sleep 1
Enter
Sleep 3File: examples/gh-cli/README.md
GitHub CLI
GitHub PR List
Output examples/gh-cli/gh-pr.gif
Type "gh pr list --state all"
Sleep 500ms
Enter
Sleep 5sGitHub Issue List
Output examples/gh-cli/gh-issue.gif
Type "gh issue list"
Sleep 500ms
Enter 1
Sleep 4s
Ctrl+L
Sleep 500ms
Type "gh issue view 19"
Sleep 500ms
Enter
Sleep 5sFile: examples/glow/README.md
Glow
Glow Simple
Output examples/glow/glow-simple.ascii
Output examples/glow/glow-simple.gif
Set Width 1000
Set Height 1050
Type "glow"
Enter
Sleep 1s
Enter
Sleep 1s
Escape
Sleep 1s
Type "q"
Sleep 1sGlow Full
Output examples/glow/vhs-glow.gif
Output examples/glow/glow.ascii
Set Width 1600
Set Height 1040
Sleep 1s
Type "glow"
Sleep 100ms
Enter
Sleep 1s
Hide
Tab
Type "/artichoke"
Enter
Down 2
Show
Sleep 0.5s
Down 20
Hide
Escape
Type "l"
Down 5
Show
Sleep 1s
Up@400ms 5
Hide
Type "/ulysses"
Enter
Show
Sleep 0.5s
Down@200ms 20
Hide
Escape
Type "/"
Show
Sleep 0.5s
Type@500ms "todo"
Sleep 1
Hide
Escape
Type "/ulysses"
Enter
Show
Sleep 0.5s
Type@750ms "????"
Hide
Escape
Type "/artichoke"
Enter
Type "m"
Ctrl+A
Right 4
Show
Sleep 1s
Type@250ms "Tasty "
Sleep 1s
Hide
Escape
Down 5
Type "m"
Ctrl+U
Show
Sleep 1s
Type@150ms "Your new internet thing"
Sleep 3s
Hide
Ctrl+C
ShowFile: examples/gum/src/lipgloss/README.md
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.
File: examples/gum/README.md
Gum
File
Output examples/gum/file.gif
Type "gum file ./src"
Sleep 0.5s
Enter
Sleep 0.5s
Down@250ms 4
Up@250ms 1
Sleep 0.5s
Enter
Sleep 0.5s
Down@250ms 4
Sleep 0.5s
Up@250ms 2
Sleep 1sPager
Output examples/gum/pager.gif
Set Padding 32
Set FontSize 16
Set Height 600
Type "gum pager < ~/src/gum/README.md --border normal"
Sleep 0.5s
Enter
Sleep 1s
Down@15ms 40
Sleep 0.5s
Up@15ms 30
Sleep 0.5s
Down@15ms 20
Sleep 2sTable
Output examples/gum/table.gif
Type "gum table < superhero.csv -w 2,12,5,6,6,8,4,20 --height 10"
Enter
Sleep 0.5s
Down 10
Sleep 0.5s
Down 10
Sleep 0.5s
Up 10
Sleep 0.5s
Enter
Sleep 2sFile: examples/jqp/README.md
JQP
Output examples/jqp/jqp.gif
Set Width 2400
Set Height 1600
Hide
Type "curl https://dummyjson.com/products | jqp"
Enter
Sleep 1
Show
Sleep 1
[email protected]'[ .products[] | select(.category=="smartphones") ]'
Sleep 1
Enter
Sleep 1
Tab
Sleep 1
Down@25ms 20
Sleep .5
Down@25ms 20
Tab
Sleep .5
Down@25ms 30
Sleep 1
Ctrl+S
Sleep 3
Escape
Sleep 3File: examples/neofetch/README.md
Neofetch
# Source code for the VHS neofetch example.
#
# To run:
#
# vhs < neofetch.tape
Output examples/neofetch/neofetch.gif
Output examples/neofetch/neofetch.mp4
Output examples/neofetch/neofetch.webm
Output examples/neofetch/frames/
Set TypingSpeed 75ms
Set FontSize 22
Set Width 1300
Set Height 650
Type "neofetch"
Sleep 500ms
Enter
Sleep 2s
Type "Welcome to VHS!"
Sleep 1
Space
Type "A tool for generating terminal GIFs from code."
Sleep 5sFile: examples/settings/README.md
Settings
Width
Output examples/settings/width.gif
Set Height 200
Set Width 475
Type "I'm a little teapot"
Sleep 1sHeight
Output examples/settings/height.gif
Set Height 1000
Set Width 1000
Set FontSize 50
Type "I'm a big teapot"
Sleep 1sFont Family
Output examples/settings/set-font-family.gif
Set FontSize 42
Set Height 225
Set FontFamily "Monoflow"
Type "One moment please..."
Sleep 0.5sFont Size
Output examples/settings/set-font-size-10.gif
Set Height 225
Set FontSize 10
Type "Super Mushroom!!!"
Sleep 1Letter Spacing
Output examples/settings/set-letter-spacing.gif
Set FontSize 42
Set Height 225
Set LetterSpacing 20
Type "Smooooooooooooth"
Sleep 2Line Height
Output examples/settings/set-line-height.gif
Set Height 400
Set FontSize 32
Set LineHeight 1.8
Type "Stay far away!"
Sleep .5
Enter
Sleep 1Padding
Output examples/settings/set-padding.gif
Set FontSize 32
Set Height 150
Set Padding 0
Type "I'm so edgy!"
Sleep 1Margins
Output "examples/settings/set-margin.gif"
Set FontSize 20
Set Width 600
Set Height 300
Set Padding 20
# You can also use an image:
# Set MarginFill "path/to/image.png"
Set MarginFill "#79B8C3"
Set Margin 20
Type "I'm on top of an image!"
Sleep 2sWindow Bars
Output "examples/settings/set-bar.gif"
Set FontSize 25
Set Width 600
Set Height 300
Set Padding 20
Set WindowBar Colorful
Set WindowBarSize 40
Type "I have a bar!"
Sleep 2sBorder Radius
Output "examples/settings/set-border-radius.gif"
Set FontSize 25
Set Width 600
Set Height 300
Set Padding 20
Set MarginFill "#79B8C3"
Set Margin 20
Set BorderRadius 20
Type "I have round corners."
Sleep 2sTheme
Output examples/settings/set-theme.gif
Set FontSize 42
Set Height 225
Set Theme { "name": "Whimsy", "black": "#535178", "red": "#ef6487", "green": "#5eca89", "yellow": "#fdd877", "blue": "#65aef7", "purple": "#aa7ff0", "cyan": "#43c1be", "white": "#ffffff", "brightBlack": "#535178", "brightRed": "#ef6487", "brightGreen": "#5eca89", "brightYellow": "#fdd877", "brightBlue": "#65aef7", "brightPurple": "#aa7ff0", "brightCyan": "#43c1be", "brightWhite": "#ffffff", "background": "#29283b", "foreground": "#b3b0d6", "selectionBackground": "#3d3c58", "cursorAccent": "#b3b0d6", "cursor": "#b3b0d6" }
Type "I can't make up my mind."
Sleep 1Typing Speed
Output examples/settings/set-typing-speed.gif
Set Height 400
Set FontSize 32
Set TypingSpeed 25ms
Type "Bunny"
Ctrl+C
Set TypingSpeed 50ms
Type "Human"
Ctrl+C
Set TypingSpeed 100ms
Type "Tortoise"
Ctrl+C
Type@250ms "Sloth"
Ctrl+C
Sleep 1