VHS - A Tool for Generating CLI Animations

Introduction⌗
This tool is called VHS, developed in Go language. It allows you to orchestrate CLI inputs and operations through configuration files, ultimately generating GIFs, videos, and more.
Example⌗
Output neofetch.gif
Set TypingSpeed 75ms
Set FontSize 14
Set Width 944
Set Height 428
Type "neofetch"
Sleep 500ms
Enter
Sleep 2s
Type "Welcome to VHS!"
Sleep 1
Space
Type "A tool for generating terminal GIFs from code."
Sleep 5s
From the example above, we can see that we can define the final output screen resolution, simulate human typing speed, font size, and more. With Sleep, we can set the cursor waiting time; Type is for the content we want to input; Enter simulates a human pressing the Enter key.
After completing the configuration, execute vhs to generate the desired screen recording format:
vhs neofetch.tape
File: neofetch.tape
Host your GIF on vhs.charm.sh: vhs publish <file>.gif
Output .gif neofetch.gif
Set TypingSpeed 75ms
Set FontSize 14
Set Width 944
Set Height 428
Type neofetch
Sleep 500ms
Enter 1
Sleep 2s
Type Welcome to VHS!
Sleep 1s
Space 1
Type A tool for generating terminal GIFs from code.
Sleep 5s
Creating neofetch.gif...
The cover GIF of this article was generated this way. This project also supports other custom parameters, which you can refer to in the official project’s README
documentation and the examples in the examples
directory.
I hope this is helpful, Happy hacking…