agent-log-gif
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseagent-log-gif
agent-log-gif
Convert Claude Code and Codex session logs into animated terminal replays (GIF, MP4, AVIF).
将Claude Code和Codex会话日志转换为带动画的终端回放(GIF、MP4、AVIF格式)。
Prerequisites
前提条件
This skill uses to run agent-log-gif without permanent installation. Before doing anything else:
uvxbash
uvx --versionIf is not found, help the user install . Check their platform and available tools:
uvxuv- macOS with Homebrew (check ):
brew --versionbrew install uv - macOS/Linux without Homebrew:
curl -LsSf https://astral.sh/uv/install.sh | sh - Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Tell the user to restart their terminal after installing.
Do not proceed until is confirmed working.
uvx此技能使用来运行agent-log-gif,无需永久安装。在进行任何操作之前,请先执行:
uvxbash
uvx --version如果未找到,请帮助用户安装。根据用户的平台和可用工具选择对应方式:
uvxuv- 使用Homebrew的macOS(先检查):
brew --versionbrew install uv - 不使用Homebrew的macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh - Windows(PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
告知用户安装完成后重启终端。
在确认可以正常工作之前,不要进行后续操作。
uvxDiscovering options and session sources
查看选项与会话源
Run to discover current options AND detect available session sources. The help output includes a "Sessions:" line showing which sources (Claude Code, Codex, or both) are detected on this machine:
--helpbash
uvx agent-log-gif json --helpUse this output to understand available flags — the tool evolves, so always check rather than assuming options from memory. The main help also shows tool availability:
bash
uvx agent-log-gif --helpgets help on all available options; note that the option is for an interactive mode you won't be able to navigate inside a skill.
local运行命令可查看当前选项并检测可用的会话源。帮助输出中会包含“Sessions:”一行,显示当前机器上检测到的源(Claude Code、Codex或两者都有):
--helpbash
uvx agent-log-gif json --help请参考此输出了解可用的参数——该工具会不断更新,因此请始终通过此方式查看,不要凭记忆假设选项。主帮助信息也会显示工具的可用功能:
bash
uvx agent-log-gif --help此命令可查看所有可用选项;请注意,选项用于交互模式,在技能内部无法操作该模式。
localFinding sessions
查找会话
Listing available sessions
列出可用会话
Use the built-in flag to browse recent sessions — it shows dates, sizes, summaries, and full file paths:
--listbash
undefined使用内置的标记可浏览最近的会话——会显示会话日期、大小、摘要和完整文件路径:
--listbash
undefinedList recent Claude Code sessions
列出最近的Claude Code会话
uvx agent-log-gif json --list=claude
uvx agent-log-gif json --list=claude
List recent Codex sessions
列出最近的Codex会话
uvx agent-log-gif json --list=codex
Run whichever source(s) the `--help` output showed as detected. If both exist, list both and let the user pick. The output includes full file paths ready to use in the next command.uvx agent-log-gif json --list=codex
运行`--help`输出中显示的已检测到的源对应的命令。如果两者都存在,可列出所有会话并让用户选择。输出会包含可直接用于下一条命令的完整文件路径。Keyword search
关键词搜索
When the user mentions a topic or keyword, use the built-in search command:
bash
undefined当用户提及某个主题或关键词时,使用内置的搜索命令:
bash
undefinedSearch both Claude Code and Codex sessions
搜索Claude Code和Codex会话
uvx agent-log-gif search "keyword"
uvx agent-log-gif search "keyword"
Search only one source
仅搜索单个源
uvx agent-log-gif search "keyword" --source claude
uvx agent-log-gif search "keyword" --source codex
This returns matching sessions with dates, sizes, summaries, and full file paths.uvx agent-log-gif search "keyword" --source claude
uvx agent-log-gif search "keyword" --source codex
此命令会返回匹配的会话,包含日期、大小、摘要和完整文件路径。Direct file path
直接使用文件路径
If the user provides a path or the session is already identified, skip discovery and go straight to generation.
如果用户提供了路径或会话已确定,可跳过发现步骤,直接生成动画。
Generating the animation
生成动画
bash
uvx agent-log-gif json <session-path> -o <output-path> [options] --openbash
uvx agent-log-gif json <session-path> -o <output-path> [options] --openSensible defaults
合理的默认设置
- Format: GIF unless the user asks for video
- Chrome style: Detect the user's OS and match:
- macOS →
--chrome mac - Linux →
--chrome linux - Other/unsure →
--chrome mac
- macOS →
- Color scheme: Dracula (default) — don't add unless the user has a preference
--color-scheme - Output path: Descriptive name in the current directory, like
session-replay.gif - Turns: Let the default cap (20) apply unless requested otherwise
- --open: Always include so the user sees the result
- 格式:默认使用GIF,除非用户要求视频格式
- Chrome样式:检测用户的操作系统并匹配对应样式:
- macOS →
--chrome mac - Linux →
--chrome linux - 其他/不确定 →
--chrome mac
- macOS →
- 配色方案:默认使用Dracula配色——除非用户有偏好,否则不要添加参数
--color-scheme - 输出路径:在当前目录下生成描述性名称的文件,例如
session-replay.gif - 轮次:使用默认上限(20),除非用户另有要求
- --open:始终添加此参数,以便用户查看结果
Walking through options
选项说明
If the user wants to customize, present the key choices conversationally. Refer to the output for the current set of options, but the main ones are typically:
--help- Format: GIF (default), MP4, AVIF
- Window frame style ()
--chrome - Color theme () — 480+ terminal color schemes available
--color-scheme - What to show () — conversation only, tool calls, everything
--show - Size (,
--cols,--rows)--font-size
Build the command from their choices and confirm before running.
如果用户想要自定义设置,可以对话式地呈现关键选项。请参考输出获取当前的选项列表,主要选项通常包括:
--help- 格式:GIF(默认)、MP4、AVIF
- 窗口框架样式()
--chrome - 配色主题()——支持480多种终端配色方案
--color-scheme - 显示内容():仅对话、仅工具调用、全部内容
--show - 尺寸(、
--cols、--rows)--font-size
根据用户的选择构建命令,并在运行前确认。
Example commands
示例命令
bash
undefinedbash
undefinedBasic — auto-opens result
基础用法——自动打开结果
uvx agent-log-gif json ~/.claude/projects/.../session.jsonl -o demo.gif --open
uvx agent-log-gif json ~/.claude/projects/.../session.jsonl -o demo.gif --open
Customized
自定义设置
uvx agent-log-gif json session.jsonl -o replay.gif --chrome linux --color-scheme Nord --show tools --turns 5
uvx agent-log-gif json session.jsonl -o replay.gif --chrome linux --color-scheme Nord --show tools --turns 5
Interactive picker (shortcut when no search needed)
交互式选择器(无需搜索时的快捷方式)
uvx agent-log-gif
undefineduvx agent-log-gif
undefinedCreating synthetic sessions from scratch
从零开始创建合成会话
Users may want a GIF that illustrates a hypothetical conversation rather than replaying an existing session — for demos, docs, tutorials, or marketing. You can generate a JSONL file from scratch and feed it to the tool.
用户可能需要一个展示假设性对话的GIF,而非回放现有会话——用于演示、文档、教程或营销。你可以从零开始生成JSONL文件,然后将其输入到工具中。
JSONL format
JSONL格式
Each line is a JSON object. The first line is a summary, then a stream of and messages. Here's a minimal example with a tool call:
userassistantjsonl
{"type":"summary","summary":"Demo: adding a test"}
{"type":"user","timestamp":"2025-01-15T10:00:00.000Z","message":{"role":"user","content":"Add a test for the login endpoint"}}
{"type":"assistant","timestamp":"2025-01-15T10:00:08.000Z","message":{"role":"assistant","content":[{"type":"text","text":"I'll create a test for the login endpoint."},{"type":"tool_use","id":"toolu_01","name":"Write","input":{"file_path":"tests/test_login.py","content":"def test_login():\n response = client.post('/login', json={'user': 'admin', 'pass': 'secret'})\n assert response.status_code == 200\n"}}]}}
{"type":"user","timestamp":"2025-01-15T10:00:12.000Z","message":{"role":"user","content":[{"type":"tool_result","tool_use_id":"toolu_01","content":"File written successfully"}]}}
{"type":"assistant","timestamp":"2025-01-15T10:00:18.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Done! The test is ready. Run pytest to verify it passes."}]}}Note: tool results use — this is the API protocol, not human input. The harness sends tool output back to the model as user messages.
type: "user"每一行都是一个JSON对象。第一行是摘要,后续是和消息流。以下是包含工具调用的最简示例:
userassistantjsonl
{"type":"summary","summary":"Demo: adding a test"}
{"type":"user","timestamp":"2025-01-15T10:00:00.000Z","message":{"role":"user","content":"Add a test for the login endpoint"}}
{"type":"assistant","timestamp":"2025-01-15T10:00:08.000Z","message":{"role":"assistant","content":[{"type":"text","text":"I'll create a test for the login endpoint."},{"type":"tool_use","id":"toolu_01","name":"Write","input":{"file_path":"tests/test_login.py","content":"def test_login():\n response = client.post('/login', json={'user': 'admin', 'pass': 'secret'})\n assert response.status_code == 200\n"}}]}}
{"type":"user","timestamp":"2025-01-15T10:00:12.000Z","message":{"role":"user","content":[{"type":"tool_result","tool_use_id":"toolu_01","content":"File written successfully"}]}}
{"type":"assistant","timestamp":"2025-01-15T10:00:18.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Done! The test is ready. Run pytest to verify it passes."}]}}注意:工具结果使用——这是API协议的要求,并非人类输入。工具会将工具输出作为用户消息发送回模型。
type: "user"Key rules
关键规则
- Timestamps drive the "Churned for Xs" duration display — space them realistically (5-30s between user and assistant)
- Tool calls need matching entries with the same
tool_resulttool_use_id - User messages: plain string for typed input, or array for tool results
[{"type":"tool_result",...}] - Assistant messages: always a content array with and/or
{"type":"text"}blocks{"type":"tool_use"} - Tool calls and results are hidden by default — use or
--show toolsto include them--show all - Keep messages concise — long text gets elided in the animation
- 时间戳决定了“已处理X秒”的显示时长——请合理设置间隔(用户与助手消息之间间隔5-30秒)
- 工具调用需要匹配带有相同的
tool_use_id条目tool_result - 用户消息:输入内容为纯字符串,或工具结果为数组
[{"type":"tool_result",...}] - 助手消息:始终为包含和/或
{"type":"text"}块的内容数组{"type":"tool_use"} - 工具调用和结果默认隐藏——使用或
--show tools参数可显示它们--show all - 请保持消息简洁——长文本在动画中会被省略
Workflow
工作流程
- Write the JSONL to a temp file
- Render with
uvx agent-log-gif json <path> -o demo.gif --open - Adjust content/timing and re-render until it looks right
- 将JSONL写入临时文件
- 使用命令渲染
uvx agent-log-gif json <path> -o demo.gif --open - 调整内容/时间,重新渲染直到效果满意
Important notes
重要说明
- Always use — it handles installation automatically
uvx agent-log-gif - MP4/AVIF require ffmpeg — help the user install it if needed
- Session file URLs also work:
uvx agent-log-gif json https://... - Codex sessions are auto-detected by the tool's parser — no special flags needed
- 请始终使用——它会自动处理安装
uvx agent-log-gif - 生成MP4/AVIF需要ffmpeg——如果需要,请帮助用户安装
- 会话文件的URL也可使用:
uvx agent-log-gif json https://... - 工具的解析器会自动检测Codex会话——无需特殊参数