终端演示生成

Universal

cli-demo-generator

by daymade

快速生成 CLI 动画演示、终端录屏和 GIF,支持从命令描述自动生成、批量产出或交互录制,适合做安装流程、功能展示、教程文档里的命令行演示。

把命令行操作做成可分享的动画演示更轻松,既能手写 tape 精细控制,也能按命令描述自动生成,效率和表现力都在线。

855效率与工作流未扫描2026年3月5日

安装

claude skill add --url github.com/daymade/claude-code-skills/tree/main/cli-demo-generator

文档

CLI Demo Generator

Generate professional animated CLI demos with ease. This skill supports both automated generation from command descriptions and manual control for custom demos.

When to Use This Skill

Trigger this skill when users request:

  • "Create a demo showing how to install my package"
  • "Generate a CLI demo of these commands"
  • "Make an animated GIF of my terminal workflow"
  • "Record a terminal session and convert to GIF"
  • "Batch generate demos from this config"
  • "Create an interactive typing demo"

Core Capabilities

1. Automated Demo Generation (Recommended)

Use the auto_generate_demo.py script for quick, automated demo creation. This is the easiest and most common approach.

Basic Usage:

bash
scripts/auto_generate_demo.py \
  -c "npm install my-package" \
  -c "npm run build" \
  -o demo.gif

With Options:

bash
scripts/auto_generate_demo.py \
  -c "command1" \
  -c "command2" \
  -o output.gif \
  --title "Installation Demo" \
  --theme "Dracula" \
  --width 1400 \
  --height 700

Script Parameters:

  • -c, --command: Command to include (can be specified multiple times)
  • -o, --output: Output GIF file path (required)
  • --title: Demo title (optional, shown at start)
  • --theme: VHS theme (default: Dracula)
  • --font-size: Font size (default: 16)
  • --width: Terminal width (default: 1400)
  • --height: Terminal height (default: 700)
  • --no-execute: Generate tape file only, don't execute VHS

Smart Features:

  • Automatic timing based on command complexity
  • Optimized sleep durations (1-3s depending on operation)
  • Proper spacing between commands
  • Professional defaults

2. Batch Demo Generation

Use batch_generate.py for creating multiple demos from a configuration file.

Configuration File (YAML):

yaml
demos:
  - name: "Install Demo"
    output: "install.gif"
    title: "Installation"
    theme: "Dracula"
    commands:
      - "npm install my-package"
      - "npm run build"

  - name: "Usage Demo"
    output: "usage.gif"
    commands:
      - "my-package --help"
      - "my-package run"

Usage:

bash
scripts/batch_generate.py config.yaml --output-dir ./demos

When to Use Batch Generation:

  • Creating a suite of related demos
  • Documenting multiple features
  • Generating demos for tutorials or documentation
  • Maintaining consistent demo series

3. Interactive Recording

Use record_interactive.sh for recording live terminal sessions.

Usage:

bash
scripts/record_interactive.sh output.gif \
  --theme "Dracula" \
  --width 1400

Recording Process:

  1. Script starts asciinema recording
  2. Type commands naturally in your terminal
  3. Press Ctrl+D when finished
  4. Script auto-converts to GIF via VHS

When to Use Interactive Recording:

  • Demonstrating complex workflows
  • Showing real command output
  • Capturing live interactions
  • Recording debugging sessions

4. Manual Tape File Creation

For maximum control, create VHS tape files manually using templates.

Available Templates:

  • assets/templates/basic.tape - Simple command demo
  • assets/templates/interactive.tape - Typing simulation

Example Workflow:

  1. Copy template: cp assets/templates/basic.tape my-demo.tape
  2. Edit commands and timing
  3. Generate GIF: vhs < my-demo.tape

Consult references/vhs_syntax.md for complete VHS syntax reference.

Workflow Guidance

For Simple Demos (1-3 commands)

Use automated generation for quick results:

bash
scripts/auto_generate_demo.py \
  -c "echo 'Hello World'" \
  -c "ls -la" \
  -o hello-demo.gif \
  --title "Hello Demo"

For Multiple Related Demos

Create a batch configuration file and use batch generation:

  1. Create demos-config.yaml with all demo definitions
  2. Run: scripts/batch_generate.py demos-config.yaml --output-dir ./output
  3. All demos generate automatically with consistent settings

For Interactive/Complex Workflows

Use interactive recording to capture real behavior:

bash
scripts/record_interactive.sh my-workflow.gif
# Type commands naturally
# Ctrl+D when done

For Custom Timing/Layout

Create manual tape file with precise control:

  1. Start with template or generate base tape with --no-execute
  2. Edit timing, add comments, customize layout
  3. Generate: vhs < custom-demo.tape

Best Practices

Refer to references/best_practices.md for comprehensive guidelines. Key recommendations:

Timing:

  • Quick commands (ls, pwd): 1s sleep
  • Standard commands (grep, cat): 2s sleep
  • Heavy operations (install, build): 3s+ sleep

Sizing:

  • Standard: 1400x700 (recommended)
  • Compact: 1200x600
  • Presentations: 1800x900

Themes:

  • Documentation: Nord, GitHub Dark
  • Code demos: Dracula, Monokai
  • Presentations: High-contrast themes

Duration:

  • Target: 15-30 seconds
  • Maximum: 60 seconds
  • Create series for complex topics

Troubleshooting

VHS Not Installed

bash
# macOS
brew install vhs

# Linux (via Go)
go install github.com/charmbracelet/vhs@latest

Asciinema Not Installed

bash
# macOS
brew install asciinema

# Linux
sudo apt install asciinema

Demo File Too Large

Solutions:

  1. Reduce duration (shorter sleep times)
  2. Use smaller dimensions (1200x600)
  3. Consider MP4 format: Output demo.mp4
  4. Split into multiple shorter demos

Output Not Readable

Solutions:

  1. Increase font size: --font-size 18
  2. Use wider terminal: --width 1600
  3. Choose high-contrast theme: --theme "Dracula"
  4. Test on target display device

Examples

Example 1: Quick Install Demo

User request: "Create a demo showing npm install"

bash
scripts/auto_generate_demo.py \
  -c "npm install my-package" \
  -o install-demo.gif \
  --title "Package Installation"

Example 2: Multi-Step Tutorial

User request: "Create a demo showing project setup with git clone, install, and run"

bash
scripts/auto_generate_demo.py \
  -c "git clone https://github.com/user/repo.git" \
  -c "cd repo" \
  -c "npm install" \
  -c "npm start" \
  -o setup-demo.gif \
  --title "Project Setup" \
  --theme "Nord"

Example 3: Batch Generation

User request: "Generate demos for all my CLI tool features"

  1. Create features-demos.yaml:
yaml
demos:
  - name: "Help Command"
    output: "help.gif"
    commands: ["my-tool --help"]

  - name: "Init Command"
    output: "init.gif"
    commands: ["my-tool init", "ls -la"]

  - name: "Run Command"
    output: "run.gif"
    commands: ["my-tool run --verbose"]
  1. Generate all:
bash
scripts/batch_generate.py features-demos.yaml --output-dir ./demos

Example 4: Interactive Session

User request: "Record me using my CLI tool interactively"

bash
scripts/record_interactive.sh my-session.gif --theme "Tokyo Night"
# User types commands naturally
# Ctrl+D to finish

Bundled Resources

scripts/

  • auto_generate_demo.py - Automated demo generation from command lists
  • batch_generate.py - Generate multiple demos from YAML/JSON config
  • record_interactive.sh - Record and convert interactive terminal sessions

references/

  • vhs_syntax.md - Complete VHS tape file syntax reference
  • best_practices.md - Demo creation guidelines and best practices

assets/

  • templates/basic.tape - Basic command demo template
  • templates/interactive.tape - Interactive typing demo template
  • examples/batch-config.yaml - Example batch configuration file

Dependencies

Required:

Optional:

  • asciinema (for interactive recording)
  • PyYAML (for batch YAML configs): pip install pyyaml

Output Formats

VHS supports multiple output formats:

tape
Output demo.gif     # GIF (default, best for documentation)
Output demo.mp4     # MP4 (better compression for long demos)
Output demo.webm    # WebM (smaller file size)

Choose based on use case:

  • GIF: Documentation, README files, easy embedding
  • MP4: Longer demos, better quality, smaller size
  • WebM: Web-optimized, smallest file size

Summary

This skill provides three main approaches:

  1. Automated (auto_generate_demo.py) - Quick, easy, smart defaults
  2. Batch (batch_generate.py) - Multiple demos, consistent settings
  3. Interactive (record_interactive.sh) - Live recording, real output

Choose the approach that best fits the user's needs. For most cases, automated generation is the fastest and most convenient option.

相关 Skills

PPT处理

by anthropics

Universal
热门

处理 .pptx 全流程:创建演示文稿、提取和解析幻灯片内容、批量修改现有文件,支持模板套用、合并拆分、备注评论与版式调整。

涉及PPTX的创建、解析、修改到合并拆分都能一站搞定,连备注、模板和评论也能处理,做演示文稿特别省心。

效率与工作流
未扫描119.1k

技能工坊

by anthropics

Universal
热门

覆盖 Skill 从创建到迭代优化全流程:起草能力、补测试提示、跑评测与基准方差分析,并持续改写内容和描述,提升效果与触发准确率。

技能工坊把技能从创建、迭代到评测串成闭环,方差分析加描述优化,特别适合把触发准确率打磨得更稳。

效率与工作流
未扫描119.1k

Word文档

by anthropics

Universal
热门

覆盖Word/.docx文档的创建、读取、编辑与重排,适合生成报告、备忘录、信函和模板,也能处理目录、页眉页脚、页码、图片替换、查找替换、修订批注及内容提取整理。

搞定 .docx 的创建、改写与精排版,目录、批量替换、批注修订和图片更新都能自动化,做正式文档尤其省心。

效率与工作流
未扫描119.1k

相关 MCP 服务

文件系统

编辑精选

by Anthropic

热门

Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。

这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。

效率与工作流
83.9k

by wonderwhy-er

热门

Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。

这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。

效率与工作流
5.9k

EdgarTools

编辑精选

by dgunning

热门

EdgarTools 是无需 API 密钥即可解析 SEC EDGAR 财报的开源 Python 库。

这个工具解决了金融数据获取的痛点——直接让 AI 读取结构化财报,比如让 Claude 分析苹果的 10-K 文件。适合量化分析师或金融开发者快速构建数据管道。但注意,它依赖 SEC 网站稳定性,高峰期可能延迟。

效率与工作流
2.0k

评论