-Write terminal GIFs as code for integration testing and demoing your CLI tools.
+以代码形式编写终端 GIF,用于集成测试和演示你的 CLI 工具。
-The above example was generated with VHS ([view source](./examples/neofetch/neofetch.tape)).
+上面的示例由 VHS 生成([查看源码](./examples/neofetch/neofetch.tape))。
-## Tutorial
+## 教程
-To get started, [install VHS](#installation) and create a new `.tape` file.
+要开始使用,请[安装 VHS](#installation),并创建一个新的 `.tape` 文件。
```sh
vhs new demo.tape
```
-Open the `.tape` file with your favorite `$EDITOR`.
+使用你喜欢的 `$EDITOR` 打开 `.tape` 文件。
```sh
vim demo.tape
```
-Tape files consist of a series of [commands](#vhs-command-reference). The commands are
-instructions for VHS to perform on its virtual terminal. For a list of all
-possible commands see [the command reference](#vhs-command-reference).
+Tape 文件由一系列[命令](#vhs-command-reference)组成。这些命令是 VHS 在其虚拟终端上执行的指令。要查看所有可用命令,请参阅[命令参考](#vhs-command-reference)。
```elixir
# Where should we write the GIF?
@@ -55,14 +59,13 @@ Enter
Sleep 5s
```
-Once you've finished, save the file and feed it into VHS.
+完成后,保存文件并将其输入 VHS。
```sh
vhs demo.tape
```
-All done! You should see a new file called `demo.gif` (or whatever you named
-the `Output`) in the directory.
+全部完成!你应该会在目录中看到名为 `demo.gif` 的新文件(或你命名的 `Output`)。
@@ -70,14 +73,14 @@ the `Output`) in the directory.
-For more examples see the [`examples/`](https://github.com/charmbracelet/vhs/tree/main/examples) directory.
+更多示例请参阅 [`examples/`](https://github.com/charmbracelet/vhs/tree/main/examples) 目录。
-## Installation
+## 安装
> [!NOTE]
-> VHS requires [`ttyd`](https://github.com/tsl0922/ttyd) and [`ffmpeg`](https://ffmpeg.org) to be installed and available on your `PATH`.
+> VHS 需要安装 [`ttyd`](https://github.com/tsl0922/ttyd) 和 [`ffmpeg`](https://ffmpeg.org),并确保它们在你的 `PATH` 上可用。
-Use a package manager:
+使用包管理器:
```sh
# macOS or Linux
@@ -93,25 +96,25 @@ nix-env -iA nixpkgs.vhs
scoop install vhs
```
-Or, use Docker to run VHS directly, dependencies included:
+或者,使用 Docker 直接运行 VHS(已包含依赖):
```sh
docker run --rm -v $PWD:/vhs ghcr.io/charmbracelet/vhs .tape
```
-Or, download it:
+或者,直接下载:
-- [Packages][releases] are available in Debian and RPM formats
-- [Binaries][releases] are available for Linux, macOS, and Windows
+- [Packages][releases] 提供 Debian 和 RPM 格式
+- [Binaries][releases] 提供适用于 Linux、macOS 和 Windows 的版本
-Or, just install it with `go`:
+或者,使用 `go` 安装:
```sh
go install github.com/charmbracelet/vhs@latest
```
-Windows, Debian, Ubuntu, Fedora, RHEL, Void Instructions
+Windows、Debian、Ubuntu、Fedora、RHEL、Void 安装说明
- Debian / Ubuntu
@@ -155,94 +158,85 @@ scoop install vhs
[releases]: https://github.com/charmbracelet/vhs/releases
-## Record Tapes
+## 录制 Tape
-VHS has the ability to generate tape files from your terminal actions!
+VHS 可以根据你的终端操作生成 tape 文件!
-To record to a tape file, run:
+要录制到 tape 文件,请运行:
```bash
vhs record > cassette.tape
```
-Perform 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:
+执行你想要的任何操作,然后 `exit` 终端会话以停止录制。你可能需要手动编辑生成的 `.tape` 文件,以添加设置或修改操作。然后,你可以生成 GIF:
```bash
vhs cassette.tape
```
-## Publish Tapes
+## 发布 Tape
-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 the
-`publish` 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 允许你将 GIF 发布到我们的服务器,以便与朋友和同事轻松分享。指定要分享的文件,然后使用 `publish` 子命令将其托管到 `vhs.charm.sh`。输出会提供通过浏览器、HTML 和 Markdown 分享 GIF 的链接。
```bash
vhs publish demo.gif
```
-## The VHS Server
+## VHS 服务器
-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.
+VHS 内置了 SSH 服务器!当你自行托管 VHS 时,可以像本地安装一样访问它。VHS 将能够访问主机上的命令和应用程序,因此你无需在自己的机器上安装它们。
-To start the server run:
+要启动服务器,请运行:
```sh
vhs serve
```
-Configuration 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)
+- `VHS_PORT`:监听的端口(`1976`)
+- `VHS_HOST`:监听的主机(`localhost`)
+- `VHS_GID`:运行服务器时使用的组 ID(当前用户的 GID)
+- `VHS_UID`:运行服务器时使用的用户 ID(当前用户的 UID)
+- `VHS_KEY_PATH`:要使用的 SSH 密钥路径(`.ssh/vhs_ed25519`)
+- `VHS_AUTHORIZED_KEYS_PATH`:authorized keys 文件路径(为空,可公开访问)
-Then, simply access VHS from a different machine via `ssh`:
+然后,只需通过 `ssh` 从另一台机器访问 VHS:
```sh
ssh vhs.example.com < demo.tape > demo.gif
```
-## VHS Command Reference
+## VHS 命令参考
> [!NOTE]
-> You can view all VHS documentation on the command line with `vhs manual`.
+> 你可以在命令行中使用 `vhs manual` 查看所有 VHS 文档。
-There are a few basic types of VHS commands:
+VHS 命令有几种基本类型:
-- [`Output `](#output): specify file output
-- [`Require `](#require): specify required programs for tape file
-- [`Set Value`](#settings): set recording settings
-- [`Type ""`](#type): emulate typing
-- [`Left`](#arrow-keys) [`Right`](#arrow-keys) [`Up`](#arrow-keys) [`Down`](#arrow-keys): arrow keys
-- [`Backspace`](#backspace) [`Enter`](#enter) [`Tab`](#tab) [`Space`](#space): special keys
-- [`ScrollUp`](#scroll-up--down) [`ScrollDown`](#scroll-up--down): scroll terminal viewport
-- [`Ctrl[+Alt][+Shift]+`](#ctrl): press control + key and/or modifier
-- [`Sleep