asciinema
Record, replay, and share terminal sessions as lightweight text-based casts instead of video files.
asciinema is a terminal session recorder that captures everything printed to
your terminal and saves it as a structured text file in the
asciicast format (.cast),
rather than a video. Because recordings are plain text, they are tiny, perfectly
sharp at any resolution, and copyable — viewers can pause and copy-paste
commands directly from a playback. The 3.x release rewrote the tool in Rust,
replacing the previous Python implementation with a faster, dependency-free
binary.
Features
- Lightweight recordings — asciicast files are highly compressible plain text, often shrinking to 15% of the original size with gzip or zstd.
- In-terminal replay — play recordings back directly in your terminal with
asciinema play, no browser required. - Live streaming — stream your terminal session in real time to multiple viewers via a built-in HTTP server or a relay such as asciinema.org.
- Web embedding — publish recordings to asciinema.org and embed the player
in documentation, blog posts, or slides with a single
<script>tag. - Idle time trimming — automatically squash long pauses during recording
with
--idle-time-limitso replays stay snappy. - Shell completion — ships completion scripts for bash, zsh, and fish.
- Self-hostable server — recordings can be published to any compatible asciinema server, not just asciinema.org.
Installation
cargo install --locked --git https://github.com/asciinema/asciinema
asciinema 3.x is not yet on crates.io, so installation from the Git repository is required for the current Rust version.
# Debian / Ubuntu — installs the older Python 2.x version from the archive
apt install asciinema
# Fedora
dnf install asciinema
# macOS
brew install asciinema
# Arch Linux
pacman -S asciinema
# Nix
nix-env -iA nixpkgs.asciinema
Note: Distribution packages currently ship the 2.x Python version. Install from source with
cargoabove to get the 3.x Rust version.
Usage
Recording a session
# Record to a file
asciinema rec demo.cast
# Record with a cap on idle time (pauses longer than 2 s are trimmed)
asciinema rec --idle-time-limit 2 demo.cast
# Append to an existing recording
asciinema rec --append demo.cast
Press ctrl-d or type exit to stop recording.
Replaying a recording
# Replay at recorded speed
asciinema play demo.cast
# Replay at double speed
asciinema play --speed 2 demo.cast
# Replay with idle time capped at 1 s
asciinema play --idle-time-limit 1 demo.castInspecting a recording
# Print the full output of a session (no timing)
asciinema cat demo.castPublishing
# Upload to asciinema.org and get a shareable URL
asciinema upload demo.cast
# Record and upload in one step
asciinema rec --stdin demo.cast && asciinema upload demo.castLive streaming
# Stream via a local HTTP server (viewers open the printed URL)
asciinema stream --serve
# Stream via asciinema.org as a relay
asciinema stream --relayasciicast format
Recordings are newline-delimited JSON files. Each line after the header is an event:
{"version": 2, "width": 220, "height": 50, "timestamp": 1700000000}
[0.248, "o", "$ "]
[1.002, "o", "ls -lh\r\n"]
[1.134, "o", "total 4.0K\r\n-rw-r--r-- 1 user user 123 Jan 1 12:00 demo.cast\r\n"]
Because the format is plain text, recordings can be diffed, grepped, edited in any text editor, and processed with standard Unix tools.
asciinema vs screen recording video
| asciinema | Video (mp4/mov) | |
|---|---|---|
| File size | Tiny (text) | Large (frames) |
| Copy-paste from playback | ✅ | ❌ |
| Searchable content | ✅ | ❌ |
| Renders at any resolution | ✅ | ❌ |
| Embeddable in a browser | ✅ | ✅ |
| Records mouse/GUI | ❌ | ✅ |