Cli demo generator

From seaworld008/Commonly-used-high-value-skills · View interactive version

Cli demo generator is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. Create terminal recordings and animated CLI demo GIFs from command workflows or VHS tape files.

How to use this skill

Skill file

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:

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:

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

With Options:

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

Script Parameters:

Smart Features:

2. Batch Demo Generation

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

Configuration File (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:

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

When to Use Batch Generation:

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:

4. Manual Tape File Creation

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

Available Templates:

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:

python3 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: python3 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:

Sizing:

Themes:

Duration:

Troubleshooting

VHS Not Installed

# macOS
brew install vhs

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

Asciinema Not Installed

# 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"

python3 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"

python3 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:
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:
python3 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/

references/

assets/

Dependencies

Required:

Optional:

Output Formats

VHS supports multiple output formats:

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:

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.