asciinema是一套用于记录、重放和共享终端会话的工具
介绍
- 源码
- docs
- 核心
- asciicast v2 是一种基于newline-delimited JSON 的终端会话文件格式,由 asciinema CLI(2.0 及更高版本)记录,记录 the event stream,格式
header包含记录元数据的 JSON 编码对象,包括- Required header attributes
versionwidthheight
- Optional header attributes
timestamp开始时间戳,秒durationidle_time_limitcommandtitleenv键值对theme
- Required header attributes
Event stream事件流[time, code, data]time(浮点数)表示事件发生的时间,用录音会话开始后的秒数表示code(字符串)指定事件类型,可选o、i、m、r之一ooutput, data written to a terminaliinput, data read from a terminalmmarker, 参考rresize
data(任意)事件特定数据
- asciicast v2 是一种基于newline-delimited JSON 的终端会话文件格式,由 asciinema CLI(2.0 及更高版本)记录,记录 the event stream,格式
{"version": 2, "width": 80, "height": 24, "timestamp": 1504467315, "title": "Demo", "env": {"TERM": "xterm-256color", "SHELL": "/bin/zsh"}}
[0.248848, "o", "\u001b[1;31mHello \u001b[32mWorld!\u001b[0m\n"]
[1.001376, "o", "That was ok\rThis is better."]
[1.500000, "m", ""]
[2.143733, "o", "Now... "]
[4.050000, "r", "80x24"]
[6.541828, "o", "Bye!"]安装
# ubuntu
sudo apt install asciinema
# mac
brew install asciinema使用
# 录制
asciinema rec demo.cast
# 回放
asciinema play demo.cast
# 分享,支持公开和私有,执行后可以在公网访问
asciinema auth
asciinema upload demo.cast快捷键
播放时,支持使用快捷键,参考
space播放/暂停f切换全屏模式← / →倒带 5 秒 / 快进 5 秒Shift + ← / Shift + →倒带 10%/快进 10[左侧方括号,倒回上一个标记]右方括号,快进到下一个标记0, 1, 2 ... 9跳转到 0%、10%、20% … 90%.每次播放一帧录像(暂停时)
最近更新
最新评论