asciinema vs AgentGIF — Terminal Recording Comparison

Comparison of asciinema and AgentGIF for terminal recording: features, formats, embedding, and AI agent support.

概述

asciinema is a terminal session recorder that captures input/output as lightweight text-based recordings (.cast files). It's open-source, self-hostable, and has been the standard for terminal recording since 2012.

AgentGIF is a developer GIF hosting platform with a dual-layer architecture: every GIF has a visual layer (GIF image) for humans and a machine layer (cast + transcript) for AI agents. It uses VHS for recording and serves both GIF images and structured data.

功能对比

功能asciinemaAgentGIF
录制实时终端捕获通过 VHS tape 文件编排
输出格式.cast (基于文本).gif + .mp4 + .cast
视觉预览需要 JavaScript 播放器内嵌 GIF 随处可播放
GitHub README链接到外部播放器内嵌 <img> 标签
文件大小极小(KB 级)中等(100 KB – 5 MB)
播放质量完美(矢量文本)良好(栅格化像素)
从终端复制是(可选中文本)否(图片)
主题通过播放器设置44 个内置 VHS 主题
AI 代理支持仅 cast 文件Cast + 脚本记录 + .md + JSON API
搜索仅标题全文搜索(标题、命令、脚本记录、标签)
自托管是(asciinema-server)否(托管平台)
开源是(GPL-3.0)否(托管服务)
API有限30+ 个 REST 端点 + OpenAPI
嵌入方式iframe、JavaScript 播放器Markdown、HTML、iframe、oEmbed、Badge、Script
徽章服务终端主题 SVG 徽章

录制

asciinema:实时捕获

asciinema 实时录制你的实际终端会话:

asciinema rec demo.cast
# ... type commands naturally ...
# Press Ctrl+D to stop

优点:自然输入,捕获包括错误在内的真实输出。缺点:不可复现——每次录制都是独一无二的。

AgentGIF:脚本录制

AgentGIF 使用 VHS tape 文件——脚本化录制,每次产生完全相同的输出:

# demo.tape
Output demo.gif
Set Theme "Catppuccin Mocha"
Type "docker compose up -d"
Enter
Sleep 3s

优点:可复现、可版本控制,非常适合 CI/CD。缺点:需要编写脚本。

输出格式

格式asciinemaAgentGIF备注
.cast主要支持基于文本,体积极小,质量完美
.gif通过转换主要通用显示,无需播放器
.mp4通过转换自动生成比 GIF 更小,需要视频播放器
.svg通过 agg仅徽章矢量画质

在 GitHub README 中嵌入

asciinema

asciinema 录制需要 JavaScript 播放器。由于 GitHub 会移除脚本,你只能使用链接方式:

[![asciicast](https://asciinema.org/a/12345.svg)](https://asciinema.org/a/12345)

这会显示一个静态 SVG 预览,链接到 asciinema 播放器页面。

AgentGIF

GIF 图片无需任何播放器即可内嵌显示:

<p align="center">
  <img src="https://media.agentgif.com/ID.gif" alt="demo" width="800">
</p>

演示自动播放——无需点击,无需访问外部页面。

AI 代理支持

这是两个平台差异最为显著之处:

功能asciinemaAgentGIF
机器可读数据.cast 文件.cast + 脚本记录 + JSON API + .md
全文搜索是(命令、输出、标签)
结构化元数据标题、命令标题、命令、标签、工具、主题、尺寸
LLM 优化输出每个页面都有 .md 端点
站点级摘要llms.txt
OpenAPI 规范完整 OpenAPI 3.1

托管

方面asciinemaAgentGIF
自托管选项是(asciinema-server)
托管平台asciinema.orgagentgif.com
CDN 分发asciinema CDNCloudflare R2 (media.agentgif.com)
定价免费(托管)/ 自托管费用免费

何时使用

在以下情况选择 asciinema:

在以下情况选择 AgentGIF:

结合使用

asciinema 和 AgentGIF 是互补的。常见工作流程:

  1. 用 asciinema 录制自然交互: asciinema rec demo.cast
  2. 使用 agg 或 VHS 转换为 GIF: agg demo.cast demo.gif
  3. 将 cast 文件上传到 AgentGIF: agentgif upload demo.gif --cast demo.cast
  4. 将 GIF 嵌入到你的 README 中(视觉层面向人类,cast 层面向代理)