Skip if the change is internal (save format, CI, docs prose) — the demo only cares about what a viewer sees on the terminal.
-
Build a release-optimized dev binary:
cargo build --release
The demo mode (--demo-for-recording) is gated behind build_info::is_dev_build(), i.e. the Cargo.toml version stays at 0.0.0. If the version is patched (e.g. during a CI release build), --demo-for-recording silently no-ops.
-
Record with asciinema, emitting asciicast v2 (agg 1.7 handles v2 reliably):
asciinema rec /tmp/cuqueclicker_demo.cast \
--output-format asciicast-v2 \
--window-size 140x42 --overwrite \
--command "./target/release/cuqueclicker --demo-for-recording 35 --no-debug"
--demo-for-recording 35 → 35-second auto-play. Accepts any integer; try 25 for a snappier clip or 45 for more variety.
--no-debug → hides the F1-F4 dev overlay so the demo doesn't advertise cheat keys.
--window-size 140x42 — NOT --cols/--rows (asciinema silently ignores those and falls back to 80×24). Verify via head -1 /tmp/cuqueclicker_demo.cast — the v2 header should read "width":140,"height":42.
-
Render to GIF with a pitch-black custom theme:
agg --fps-cap 30 --font-size 20 \
--theme "000000,ffffff,000000,dd3c69,4ebf22,ddaf3c,26b0d7,b954e1,54e1b9,d9d9d9,4d4d4d,dd3c69,4ebf22,ddaf3c,26b0d7,b954e1,54e1b9,ffffff" \
/tmp/cuqueclicker_demo.cast /tmp/demo.gif
--theme custom (the literal word) is rejected by agg. Pass an 18-color comma-separated palette instead: bg,fg,<8 normal>,<8 bright> — that's what agg treats as "custom".
- Order is
bg FIRST, then fg — not fg,bg. Flipping it silently gives you an inverted terminal (white bg, black text) and the video is wrong. First slot 000000 = pitch black background; second slot ffffff = white text.
- Always verify afterwards:
ffmpeg -ss 10 -i docs/demo.mp4 -frames:v 1 /tmp/check.png then open /tmp/check.png (or Read the image). Eyeball it before committing.
--font-size 20 keeps the text readable at README width.
-
Convert GIF → MP4 (h264, faststart for browser streaming):
ffmpeg -y -i /tmp/demo.gif \
-movflags +faststart -pix_fmt yuv420p \
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" \
docs/demo.mp4
-pix_fmt yuv420p + even-dimension scale filter → broadly compatible h264 that plays in Safari, Chrome, Firefox, and GitHub's video element.
- Expect ~2–3 MB for a 35s clip. If it's 10+ MB, shorten the recording.
-
Sanity-check:
ls -la docs/demo.mp4
ffprobe docs/demo.mp4 2>&1 | grep -E 'Duration|Video:'
-
Ask the user to upload the MP4 to GitHub — this is the one step you cannot automate. Tell them:
Please upload docs/demo.mp4 as a comment on https://github.com/flipbit03/cuqueclicker/issues/1 (drag-drop the file into the comment box), then paste the resulting https://github.com/user-attachments/assets/<uuid> URL back here so I can swap it into the README.
- That specific issue exists as the durable host for demo assets — reuse it on every re-record.
gh CLI cannot do this — the user-attachments endpoint is browser-only. Don't try gh issue comment, gh api, curl, or any scripted workaround; they all produce URLs that GitHub's README renderer refuses to auto-embed.
- The user can post or discard the comment after uploading — the asset persists on GitHub either way.
- Wait for the user to paste the URL back before proceeding.
-
Paste the user-supplied URL into README.md as a bare line (mirrors flipbit03/terminal-use's pattern):
https://github.com/user-attachments/assets/<uuid>
GitHub's README renderer auto-expands bare user-attachments URLs into inline <video> elements. Do NOT wrap in a <video> tag — GitHub's sanitizer strips custom video markup in READMEs.
-
Commit:
git add docs/demo.mp4 README.md && git commit -m "docs: re-record demo"