К основному содержанию
скилл CX Codex

cli-demo-generator — скилл для Claude Code: GIF-демо терминала

Скилл записывает команды в терминале и отдаёт готовый анимированный GIF. Пригодится для README и документации CLI-инструмента.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add daymade/claude-code-skills --skill cli-demo-generator -a claude-code
Открыть на GitHub

Что делает cli-demo-generator

Скилл собирает демо командной строки через VHS — утилиту, которая проигрывает tape-файл и пишет терминал в GIF. Вы даёте список команд, получаете файл. Четыре пути: автогенерация скриптом auto_generate_demo.py, пакетная сборка из YAML, интерактивная запись живой сессии и ручной tape-файл, когда нужен контроль до кадра.

Внутри — скрипты на Python и шаблоны tape-файлов. Автогенерация сама расставляет паузы: для install, build, test, deploy ставит 3 секунды, для ls, pwd, echo — одну. Есть флаги темы, размера шрифта, ширины и высоты терминала, а также --bootstrap для скрытой подготовки и --filter для вырезания шумных строк вывода.

Упирается всё в парсер VHS: строки Type не принимают $, \" и обратные кавычки. Команду с такими символами приходится кодировать в base64 и декодировать уже в tape. Заранее нужен сам VHS (brew install charmbracelet/tap/vhs); gifsicle, asciinema и ffmpeg подключаются по желанию — для ускорения, интерактивной записи и проверки кадров.

Какие задачи решает

  • записать установку и сборку пакета в один GIF для README
  • собрать несколько демо из одного YAML-конфига
  • спрятать подготовку окружения от зрителя
  • убрать шумные строки прогресса из вывода команды
  • ускорить готовую запись без перезаписи

Примеры запросов агенту

  • Сделай GIF-демо: покажи npm install my-package, потом npm run build, сохрани в demo.gif
  • Запиши интерактивную сессию терминала в output.gif с темой Catppuccin Latte
  • Собери демо из demos.yaml в папку ./gifs

Как установить cli-demo-generator

1Через Skills CLI (Vercel)

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

2Вручную: положить файлы

~/.claude/skills/cli-demo-generator/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/cli-demo-generator/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о cli-demo-generator

Как установить cli-demo-generator в Claude?

Выполните npx skills add daymade/claude-code-skills --skill cli-demo-generator -a claude-code. Скилл окажется в ~/.claude/skills/cli-demo-generator/SKILL.md.

Что делает cli-demo-generator?

Записывает работу командной строки через VHS и сохраняет результат как анимированный GIF. Подходит для демо в README и документации.

Почему VHS ругается на мою команду?

Парсер VHS не принимает в строках Type символы $, \" и обратные кавычки. Команду с ними кодируют в base64 и декодируют прямо в tape-файле.

Исходный текст

SKILL.md · MIT
---
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:

```bash
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:

```bash
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:

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

**Workaround: base64 encode the command**, decode at runtime:

```bash
# 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)

```bash
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:

```yaml
# 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"]
```

```bash
python3 ${CLAUDE_SKILL_DIR}/scripts/batch_generate.py demos.yaml --output-dir ./gifs
```

### 3. Interactive Recording

Record a live terminal session:

```bash
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:

```tape
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:

```tape
# 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:

```bash
# 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:

```bash
# 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:

```tape
# 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)

© daymade · MIT · daymade/claude-code-skills

Похожие скиллы

Всё по теме «Тексты и документация» →
vhs pproenca Скилл с 47 правилами для .tape-файлов VHS: помогает агенту писать и проверять сценарии записи терминала в GIF и видео. CX Codex +1 323установок demo-video Alireza Rezvani Превращает описания сцен и скриншоты в готовые демо-ролики или GIF с озвучкой и анимацией прямо в Claude Code. 708установок gifgrep openclaw Поиск гифок в Tenor и Giphy прямо из терминала, скачивание файлов и нарезка раскадровок в PNG для документации или пулреквестов. CX Codex +1 5 200установок fireworks-tech-graph yizhiyanhua-ai Генерирует точные технические схемы в SVG, экспортирует их в PNG или автономный HTML и анимирует в GIF. Пригодится при проектировании архитектуры, UML, C4 и воркфлоу агентов. CX Codex +1 18 000установок stripe-docs stripe Ищет документацию Stripe и справочник API через терминал. Нужен, когда агенту надо открыть страницу, найти термин или проверить API-метод. CX Codex +1 2 700установок loops-cli loops-so Скилл для работы с Loops CLI из терминала: установка, авторизация, ключи API и команды для контактов, кампаний и транзакционных писем. CX Codex +1 1 500установок

Из того же набора64

github-contributor Ведёт пул-реквест в проект, который вы не поддерживаете: проверка CONTRIBUTING, размер диффа, описание с раскрытием ИИ и ответы на ревью ботов. CX Codex +1 957установок video-comparer Скилл сравнивает два видео и собирает HTML-отчёт с метриками PSNR и SSIM, а также покадровым просмотром до и после сжатия. CX Codex +1 953установок llm-icon-finder Скилл находит ссылки на иконки AI-моделей и провайдеров из библиотеки lobe-icons и помогает скачать их в SVG, PNG или WEBP. CX Codex +1 952установок cloudflare-troubleshooting Скилл для диагностики конфигурации Cloudflare через API: находит причину редирект-петель, ошибок SSL и DNS, а не гадает. CX Codex +1 942установок teams-channel-post-writer Пишет обучающие посты в канал Teams про Claude: разбор фич, советы, примеры промптов и принципы вроде context engineering. CX Codex +1 935установок repomix-safe-mixer Скилл сканирует проект на захардкоженные ключи и токены и не даёт repomix упаковать код, пока секреты не убраны. CX Codex +1 912установок financial-data-collector Собирает реальные финансовые данные по публичным компаниям США из yfinance и отдаёт структурированный JSON для DCF, сравнений и разбора отчётности. CX Codex +1 883установок repomix-unmixer Распаковывает репозитории из файлов Repomix обратно в дерево каталогов. Пригодится, когда проект упакован в один XML, Markdown или JSON для ИИ. CX Codex +1 882установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой