Asciinema
Just copy and paste the gif into obsidian.
src= https://asciinema.org/a/tIh6yKtClYpCqsm5.cast

asciinema — Record Terminal & Convert to GIF
1. Record a terminal session
asciinema rec demo.cast
# ... do your terminal stuff ...
# End recording:
exit
# or press Ctrl+D
2. Play it back locally
asciinema play demo.cast
3. Convert to GIF using agg
Install agg (prebuilt binary)
wget https://github.com/asciinema/agg/releases/latest/download/agg-x86_64-unknown-linux-gnu -O agg
chmod a+x agg
sudo mv agg /usr/local/bin
agg --version
Convert
agg demo.cast demo.gif
Convert with options
# Faster playback (2x speed)
agg --speed 2 demo.cast demo.gif
# Limit idle time (compress pauses to max 2s)
agg --idle-time-limit 2 demo.cast demo.gif
# Custom font size
agg --font-size 16 demo.cast demo.gif
# Custom theme (available: asciinema, dracula, monokai, nord, solarized-dark, solarized-light)
agg --theme dracula demo.cast demo.gif
# Combine options
agg --speed 1.5 --idle-time-limit 2 --theme solarized-dark demo.cast demo.gif
4. Copy to clipboard (Ubuntu)
# Install imagemagick + xclip if needed
sudo apt install imagemagick xclip
# Copy first frame as PNG to clipboard
convert demo.gif[0] demo.png && xclip -selection clipboard -t image/png -i demo.png
💡 For the full animated GIF, drag-and-drop directly into Obsidian —
it auto-copies to your attachments folder and embeds it.
5. Embed in Obsidian

Or if in a subfolder:

6. One-liner: record → convert → done
asciinema rec demo.cast && agg --idle-time-limit 2 --theme dracula demo.cast demo.gif