feat: Add animated demos recorded with autocast and agg

Scenarios in demo/*.yaml are played by autocast into asciinema
recordings (.cast, playable in Gitea) and rendered as GIFs by agg for the
README. The recording tools and fonts (Inconsolata Nerd Font, Noto Color
Emoji) live in a separate mise environment:

    MISE_ENV=demo mise run demo <tour|install>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
This commit is contained in:
xavierandClaude Opus 5.5 committed 2026-11-21 15:16:46 +01:00
1 parent 3caef59c36
commit e31a1b9111
10 files changed
+1079

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
# Demos
The animations of the [README](../README.md) are recorded with
[autocast](https://github.com/k9withabone/autocast) from scenarios written in
YAML (`<scenario>.yaml`): the commands really run in a bash shell and the
session is written as an [asciinema](https://asciinema.org) recording
(`<scenario>.cast`), then rendered as a GIF with
[agg](https://github.com/asciinema/agg).
The `.cast` files can be played in Gitea's file view (asciinema player).
| Scenario | Demo | Prerequisites |
|---|---|---|
| `tour.yaml` | welcome message, `list`, `show`, `diff` (read only) | LXD |
| `install.yaml` | `install`, diff and confirmation after a change in LXD, `import` | LXD, profile `unattended-upgrades` not installed |
## Recording a demo
The recording tools live in a separate mise environment (`mise.demo.toml`), so
they are only installed when making demos:
```shell
MISE_ENV=demo mise run demo <scenario> # demo/<scenario>.cast and demo/<scenario>.gif
```
`setup.sh` is the hidden preamble of every scenario (mise activated, `delta` as
git pager). `install.yaml` installs the profile `unattended-upgrades` in LXD,
modifies it and imports it into the repository; its hidden epilogue restores
the repository file as it was and deletes the profile. The scenario refuses to
start if that profile is already installed.
agg draws the text itself, with fonts installed by mise in the demo environment
(nothing is installed on the system, which can be headless):
[Inconsolata Nerd Font](https://www.nerdfonts.com) and
[Noto Color Emoji](https://github.com/googlefonts/noto-emoji), passed with
`--font-dir`.