用 vhs 录制终端 GIF

编写 .tape 脚本,生成可复现的终端录像。

macOS终端媒体录屏低风险
运行 vhs demo.tape,渲染 tape 文件中定义的录像。

01命令

命令
$ vhs demo.tape

02作用说明

vhs 读取包含命令、按键和时序的 tape 脚本,驱动无头终端并导出 GIF、MP4 或 WebM。由于是脚本化录制,界面变化后可重新生成,优于一次性的 asciinema 录像。

03风险

风险低风险
系统兼容性macOS with Homebrew installed
!注意: 它需要 ffmpeg 和无头终端工具;首次运行会下载依赖,可能较慢。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • Homebrew formula: vhs
    Homebrew · vendor-doc · 2026-09-20
    依据: Your CLI home video recorder. Packages vhs, which scripts and records terminal sessions into GIFs, MP4s or WebMs.

最后验证: 2026-09-22 · 分类: 媒体

06相关方案