使用
安装
cargo install --locked --git https://github.com/asciinema/asciinema
或
git clone https://github.com/asciinema/asciinema
cd asciinema
cargo build --release
录制
asciinema rec demo.cast
直播流
本地服务:要通过内置 HTTP 服务器流式传输会话,请运行:
asciinema stream --serve
云端服务:要通过中继(asciinema 服务器)流式传输会话,即直播:
# asciinema stream -r
asciinema stream --relay
在 Web 上观看和分享它,请上传它:
# 自建服务器
export ASCIINEMA_API_URL=http://localhost:4000
asciinema rec demo.cast
asciinema upload demo.cast
转为 GIF
agg demo.cast first.gif
agg 安装
录制非 shell 命令
使用 --command / -c 录制任何命令,而不是录制 shell 选择:
asciinema rec -c htop demo.cast
播放
asciinema play demo.cast
要以双倍速度重播它,请使用 --speed / -s 选项:
asciinema play -s 2 demo.cast
asciinema 的一个独特功能是能够使用 --idle-time-limit / -i 选项优化录音中的空闲时刻:
asciinema play -i 2 demo.cast
更多教程:https://docs.asciinema.org/getting-started/