CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

asciinema

$ asciinema 官方出品 中风险
asciinema · AI 能力与音视频 · GPL-3.0-or-later · macos / linux

asciinema 将终端会话捕获为紧凑的带时间戳 NDJSON .cast 文件,替代体积庞大的视频录制。Agent 可使用 asciinema rec -c 录制脚本命令、通过 asciinema convert -f txt 去除 ANSI 转义符提取纯文本,并用 asciinema cat 拼接多个录制文件。

FCRS-1.0 综合评分
78 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install asciinema
CLI vs MCP 选型建议 仅 CLI 可用

使用 -c 录制非交互命令并通过 asciinema convert -f txt 提取纯文本记录均属于本地 shell 工作流。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 17 / 25

.cast 原生采用 NDJSON 格式且 convert -f txt 输出整洁文本,但未传 -c 的 rec 会启动交互式 shell 且 play 依赖 TTY。

  • .cast output is native NDJSON; convert -f txt strips escape codes
  • rec without filename prompts to upload; play is interactive
安全与权限边界 18 / 25

未指定文件名直接运行 asciinema rec 会在结束时提示上传至 asciinema.org,存在意外泄露终端敏感信息的风险。

  • upload and interactive rec can send terminal captures to remote servers
安装与运行摩擦 13 / 15

可通过 Homebrew、Cargo 与 Linux 包安装,但因依赖 POSIX PTY 而不支持原生 Windows。

  • macOS and Linux support only; requires POSIX PTY
能力覆盖与边际价值 13 / 15

极小巧的纯文本 .cast 制品可替代数兆字节录屏,并可无损转换为文本、原始流或 v2/v3 格式。

  • Supports rec, convert, cat, play, and stream
维护与来源背书 9 / 10

asciinema 官方 CLI(asciinema/asciinema),v3 起基于 Rust 重写并采用 GPL-3.0-or-later。

  • Official asciinema/asciinema GitHub repository
文档与可验证性 8 / 10

docs.asciinema.org 文档与内置 --help 清晰,但老旧 Linux 发行版上的 v2(Python)与 v3(Rust)在 cat 等子命令上存在差异。

  • Official CLI docs at docs.asciinema.org/manual/cli/usage

安全边界、鉴权与放权指南

鉴权方式
无需鉴权 本地配置文件 浏览器 OAuth
凭证存储位置

可选将 asciinema.org 的安装 ID 与认证信息保存在 ~/.config/asciinema/config.toml(仅 asciinema upload / auth 需要)。

潜在副作用
只读查询 本地写入 远端写入
费用与配额提示

免费,基于 GPL-3.0-or-later 协议的开源 Rust CLI(asciinema v3+)。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# asciinema Agent Rules
- Always pass an explicit local `<filename>.cast` and `-c "<command>"` on `asciinema rec` so it neither spawns an interactive shell nor prompts to upload.
- Never run `asciinema upload` or `asciinema stream` without explicit user consent, as terminal output may contain secrets.

Agent 高频安全命令配方

只读查询(安全推荐)

将 .cast 录制文件转换为纯净纯文本
asciinema convert -f txt demo.cast -

剥离 ANSI 转义序列与时间戳元数据,向标准输出输出可读的文本记录。

受控写入与预演

将非交互命令输出录制到本地 .cast 文件
asciinema rec --overwrite -c "ls -la" demo.cast

将 ls -la 的完整输出与时序捕获至 demo.cast,不触发交互提示或上传。

核心优势

  • + 原生 NDJSON .cast 格式与 asciinema convert -f txt 让终端录屏极易被 Agent 检查分析。
  • + asciinema rec -c "..." out.cast 可干净地自动化捕获单条命令过程。

注意事项与踩坑点

  • ! 不支持 Windows(依赖 POSIX PTY);部分旧 Linux 发行版仍自带 v2,cat 行为与 v3 不同。
  • ! 未提供文件名与 -c 参数时运行 asciinema rec 会进入交互 shell 并在退出时询问上传。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI