Agent Skills › daymade/claude-code-skills › cli-demo-generator

cli-demo-generator

GitHub

自动化生成专业级终端操作动画GIF的工具,支持命令录制、批量生成及手动控制。用于创建CLI演示、README文档插图及工具可视化展示,解决VHS特殊字符解析问题。

cli-demo-generator/SKILL.md daymade/claude-code-skills

Trigger Scenarios

需要生成终端操作演示GIF 为README或文档制作动画截图 录制并分享CLI工作流

Install

npx skills add daymade/claude-code-skills --skill cli-demo-generator -g -y
More Options

Non-standard path

npx skills add https://github.com/daymade/claude-code-skills/tree/main/cli-demo-generator -g -y

Use without installing

npx skills use daymade/claude-code-skills@cli-demo-generator

指定 Agent (Claude Code)

npx skills add daymade/claude-code-skills --skill cli-demo-generator -a claude-code -g -y

安装 repo 全部 skill

npx skills add daymade/claude-code-skills --all -g -y

预览 repo 内 skill

npx skills add daymade/claude-code-skills --list

SKILL.md

Frontmatter
{
    "name": "cli-demo-generator",
    "description": "Generates professional animated CLI demos as GIFs using VHS terminal recordings. Use to create terminal demos, record CLI workflows as GIFs, generate animated documentation, build demo tapes for README files, or showcase any command-line tool visually: record terminal \/ VHS tape \/ demo GIF \/ animate my CLI."
}

CLI Demo Generator

Create professional animated CLI demos. Four approaches, from fully automated to pixel-precise manual control.

Quick Start

Simplest path — give commands, get GIF:

python3 ${CLAUDE_SKILL_DIR}/scripts/auto_generate_demo.py \
  -c "npm install my-package" \
  -c "npm run build" \
  -o demo.gif

Self-bootstrapping demo — for repeatable recordings that clean their own state:

python3 ${CLAUDE_SKILL_DIR}/scripts/auto_generate_demo.py \
  -c "npm install my-package" \
  -c "npm run build" \
  -o demo.gif \
  --bootstrap "npm uninstall my-package 2>/dev/null" \
  --speed 2

Critical: VHS Parser Limitations

VHS Type strings cannot contain $, \", or backticks. These cause parse errors:

# FAILS — VHS parser rejects special chars
Type "echo \"hello $USER\""
Type "claude() { command claude \"$@\"; }"

Workaround: base64 encode the command, decode at runtime:

# 1. Encode your complex command
echo 'claude() { command claude "$@" 2>&1 | grep -v "noise"; }' | base64
# Output: Y2xhdWRlKCkgey4uLn0K

# 2. Use in tape
Type "echo Y2xhdWRlKCkgey4uLn0K | base64 -d > /tmp/wrapper.sh && source /tmp/wrapper.sh"

This pattern is essential for output filtering, function definitions, and any command with shell special characters.

Approaches

1. Automated Generation (Recommended)

python3 ${CLAUDE_SKILL_DIR}/scripts/auto_generate_demo.py \
  -c "command1" -c "command2" \
  -o output.gif \
  --title "My Demo" \
  --theme "Catppuccin Latte" \
  --font-size 24 \
  --width 1400 --height 600
Flag Default Description
-c required Command to include (repeatable)
-o required Output GIF path
--title none Title shown at start
--theme Dracula VHS theme name
--font-size 16 Font size in pt
--width 1400 Terminal width px
--height 700 Terminal height px
--bootstrap none Hidden setup command (repeatable)
--filter none Regex pattern to filter from output
--speed 1 Playback speed multiplier (uses gifsicle)
--no-execute false Generate .tape only

Smart timing: install/build/test/deploy → 3s, ls/pwd/echo → 1s, others → 2s.

2. Batch Generation

Create multiple demos from one config:

# demos.yaml
demos:
  - name: "Install"
    output: "install.gif"
    commands: ["npm install my-package"]
  - name: "Usage"
    output: "usage.gif"
    commands: ["my-package --help", "my-package run"]
python3 ${CLAUDE_SKILL_DIR}/scripts/batch_generate.py demos.yaml --output-dir ./gifs

3. Interactive Recording

Record a live terminal session:

bash ${CLAUDE_SKILL_DIR}/scripts/record_interactive.sh output.gif --theme "Catppuccin Latte"
# Type commands naturally, Ctrl+D when done

Requires asciinema (brew install asciinema).

4. Manual Tape File

For maximum control, write a tape directly. Templates in assets/templates/:

  • basic.tape — simple command sequence
  • interactive.tape — typing simulation
  • self-bootstrap.tape — self-cleaning demo with hidden setup (recommended for repeatable demos)

Advanced Patterns

These patterns come from production use. See references/advanced_patterns.md for full details.

Self-Bootstrapping Demos

Demos that clean previous state, set up environment, and hide all of it from the viewer:

Hide
Type "cleanup-previous-state 2>/dev/null"
Enter
Sleep 2s
Type "clear"
Enter
Sleep 500ms
Show

Type "the-command-users-see"
Enter
Sleep 3s

The Hide → commands → clear → Show sequence is critical. clear wipes the terminal buffer so hidden commands don't leak into the GIF.

Output Noise Filtering

Filter noisy progress lines from commands that produce verbose output:

# Hidden: create a wrapper function that filters noise
Hide
Type "echo <base64-encoded-wrapper> | base64 -d > /tmp/w.sh && source /tmp/w.sh"
Enter
Sleep 500ms
Type "clear"
Enter
Sleep 500ms
Show

# Visible: clean command, filtered output
Type "my-noisy-command"
Enter
Sleep 3s

Frame Verification

After recording, verify GIF content by extracting key frames:

# Extract frames at specific positions
ffmpeg -i demo.gif -vf "select=eq(n\,100)" -frames:v 1 /tmp/frame.png -y 2>/dev/null

# View the frame (Claude can read images)
# Use Read tool on /tmp/frame.png to verify content

Post-Processing Speed-Up

Use gifsicle to speed up recordings without re-recording:

# 2x speed (halve frame delay)
gifsicle -d2 original.gif "#0-" > fast.gif

# 1.5x speed
gifsicle -d4 original.gif "#0-" > faster.gif

Template Placeholder Pattern

Keep tape files generic with placeholders, replace at build time:

# In tape file
Type "claude plugin marketplace add MARKETPLACE_REPO"

# In build script
sed "s|MARKETPLACE_REPO|$DETECTED_REPO|g" template.tape > rendered.tape
vhs rendered.tape

Timing & Sizing Reference

Context Width Height Font Duration
README/docs 1400 600 16-20 10-20s
Presentation 1800 900 24 15-30s
Compact embed 1200 600 14-16 10-15s
Wide output 1600 800 16 15-30s

See references/best_practices.md for detailed guidelines.

Troubleshooting

Problem Solution
VHS not installed brew install charmbracelet/tap/vhs
gifsicle not installed brew install gifsicle
GIF too large Reduce dimensions, sleep times, or use --speed 2
Text wraps/breaks Increase --width or decrease --font-size
VHS parse error on $ or \" Use base64 encoding (see Critical section above)
Hidden commands leak into GIF Add clear + Sleep 500ms before Show
Commands execute before previous finishes Increase Sleep duration

Tape File Syntax

references/vhs_syntax.md is the full VHS tape-file reference — every command, setting, and key name, with the argument forms each accepts. Read it when writing a tape by hand, when a tape parses but behaves unexpectedly, or when you need a command this SKILL.md does not show an example of.

Dependencies

Required: VHS (brew install charmbracelet/tap/vhs)

Optional: gifsicle (speed-up), asciinema (interactive recording), ffmpeg (frame verification), PyYAML (batch YAML configs)

Version History

  • c6903aa Current 2026-09-28 12:32

    根据提交日志,此版本主要进行了描述文本的规范化与精简(缩短剩余53个技能的描述),属于文档维护性质的变更,未涉及核心功能逻辑更新。

  • f7c2028 2026-09-23 01:31
  • e00a2ec 2026-08-20 11:25

Same Skill Collection

auto-repo-setup/SKILL.md
bilibili-source/SKILL.md
capture-screen/SKILL.md
cloudflare-troubleshooting/SKILL.md
codex-image-gallery/SKILL.md
competitors-analysis/SKILL.md
data-visualization-discipline/SKILL.md
daymade-audio/asr-transcribe-to-text/SKILL.md
daymade-audio/audio-router/SKILL.md
daymade-audio/meeting-minutes-taker/SKILL.md
daymade-audio/stepfun-asr/SKILL.md
daymade-audio/stepfun-tts/SKILL.md
daymade-audio/transcript-fixer/SKILL.md
daymade-claude-code/agent-web-search-setup/SKILL.md
daymade-claude-code/claude-code-hooks/SKILL.md
daymade-claude-code/claude-code-ops-router/SKILL.md
daymade-claude-code/claude-code-ping-start-5h-quota/SKILL.md
daymade-claude-code/claude-export-txt-better/SKILL.md
daymade-claude-code/claude-skills-troubleshooting/SKILL.md
daymade-claude-code/claude-switch-models-setup/SKILL.md
daymade-claude-code/claude-usage-analyst/SKILL.md
daymade-claude-code/continue-claude-code-work/SKILL.md
daymade-claude-code/continue-claude-work/SKILL.md
daymade-claude-code/continue-codex-work/SKILL.md
daymade-claude-code/lark-cli-router/SKILL.md
daymade-claude-code/local-conversation-history/SKILL.md
daymade-claude-code/marketplace-dev/SKILL.md
daymade-claude-code/prior-work-retrieval/SKILL.md
daymade-claude-code/read-claude-code-history/SKILL.md
daymade-claude-code/read-claude-web-conversation/SKILL.md
daymade-claude-code/read-codex-history/SKILL.md
daymade-claude-code/statusline-generator/SKILL.md
daymade-claude-code/tech-selection/SKILL.md
daymade-claude-code/terminal-screenshot/SKILL.md
daymade-codex/codex-1m-context-window-setup/SKILL.md
daymade-codex/codex-image-gallery/SKILL.md
daymade-codex/design-style-picker/SKILL.md
daymade-codex/interaction-design-board/SKILL.md
daymade-codex/local-codex/SKILL.md
daymade-docs/docs-router/SKILL.md
daymade-docs/docx-creator/SKILL.md
daymade-docs/excel-automation/SKILL.md
daymade-docs/mermaid-tools/SKILL.md
daymade-docs/pdf-creator/SKILL.md
daymade-docs/ppt-creator/SKILL.md
daymade-docs/read-docx-review/SKILL.md
daymade-financial/ashare-news-fetcher/SKILL.md
daymade-financial/benchmark-due-diligence/SKILL.md
daymade-financial/bigdata-skill/SKILL.md

Metadata

Files
0
Version
c6903aa
Hash
689e1d6f
Indexed
2026-08-20 11:25

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-29 14:36
浙ICP备14020137号-1