Files
asciinema/README.md

164 lines
6.1 KiB
Markdown
Raw Normal View History

2015-03-06 11:59:27 +01:00
# asciinema
2013-10-03 17:57:40 +02:00
2024-01-10 12:13:50 +01:00
[![Build Status](https://github.com/asciinema/asciinema/actions/workflows/ci.yml/badge.svg)](https://github.com/asciinema/asciinema/actions/workflows/asciinema.yml)
2015-08-07 17:04:55 -04:00
[![license](http://img.shields.io/badge/license-GNU-blue.svg)](https://raw.githubusercontent.com/asciinema/asciinema/master/LICENSE)
2013-10-03 17:57:40 +02:00
__asciinema__ (aka asciinema CLI or asciinema recorder) is a command-line tool
2025-09-11 20:57:29 +02:00
for recording and live streaming terminal sessions.
2013-10-03 17:57:40 +02:00
Unlike typical _screen_ recording software, which records visual output of a
2025-09-11 20:57:29 +02:00
screen into a heavyweight video files (`.mp4`, `.mov`), asciinema CLI runs
_inside a terminal_, capturing terminal session output into a lightweight
recording files in the
2025-09-11 20:57:29 +02:00
[asciicast](https://docs.asciinema.org/manual/asciicast/v3/) format (`.cast`),
or streaming it live to viewers in real-time.
The recordings can be replayed in a terminal, embedded on a web page with the
[asciinema player](https://docs.asciinema.org/manual/player/), or published to
an [asciinema server](https://docs.asciinema.org/manual/server/), such as
2025-09-11 20:57:29 +02:00
[asciinema.org](https://asciinema.org), for further sharing. Live streams allow
viewers to watch terminal sessions as they happen.
asciinema runs on GNU/Linux, macOS and FreeBSD.
2023-10-03 10:06:20 +02:00
<a href="https://asciinema.org/a/756853"><img src="https://asciinema.org/a/756853.svg" alt="asciinema CLI demo" width="100%" /></a>
2023-10-03 10:06:20 +02:00
Notable features:
2023-10-03 10:06:20 +02:00
2026-04-29 16:10:29 +02:00
- recording of terminal sessions to a file, with optional [keyboard input
capture](https://docs.asciinema.org/manual/cli/quick-start/) and configurable
environment variable capture,
- replaying of recordings inside a terminal, with adjustable speed, looping,
idle time limiting, step-by-step navigation,
pause-on-[markers](https://docs.asciinema.org/manual/cli/markers/), and
optional terminal auto-resize,
2025-09-11 20:57:29 +02:00
- local and remote [live
streaming](https://docs.asciinema.org/manual/cli/quick-start/#stream-a-terminal-session)
2026-04-29 16:10:29 +02:00
of terminal sessions to multiple viewers in real-time, including a built-in
HTTP server with an embedded web player for LAN/localhost viewing,
- combined sessions: record to a file while streaming locally and remotely at
the same time,
- [lightweight asciicast recording
2026-06-20 07:51:04 +02:00
format](https://docs.asciinema.org/manual/asciicast/v3/), with native reading
and writing of zstd-compressed (`.zst`) recordings (8% of the original size
on average),
2026-04-29 16:10:29 +02:00
- conversion from asciicast v1/v2/v3 to asciicast v2/v3, raw terminal output,
or plain text,
- concatenation of multiple recordings into one, with timing adjusted
automatically,
- mid-session controls: pause/resume capture and add markers on the fly via
[customizable key bindings](https://docs.asciinema.org/manual/cli/configuration/),
- session metadata capture, including terminal size, terminal theme, command,
and title,
- configuration file support for defaults such as recording command, capture
options, playback speed, idle time limit, notifications, and key bindings,
- headless mode, configurable terminal window size, and exit-status propagation
for scripted and CI-friendly recording and streaming,
- support for stdin/stdout in conversion and playback from local files, stdin,
or HTTP(S) URLs,
2025-09-11 20:57:29 +02:00
- integration with [asciinema
server](https://docs.asciinema.org/manual/server/), e.g.
2026-04-29 16:10:29 +02:00
[asciinema.org](https://asciinema.org), for uploads, hosting, remote live
streaming, self-hosted servers, visibility control, descriptions, and
synchronized audio URLs.
2017-11-18 22:09:15 +01:00
2024-05-07 11:18:53 +02:00
To record a session run this command in your shell:
2015-06-23 20:20:22 +02:00
```sh
asciinema rec demo.cast
2017-11-19 18:29:50 +01:00
```
2015-03-09 17:05:14 +01:00
2024-05-07 11:18:53 +02:00
To stream a session via built-in HTTP server run:
```sh
2025-09-11 20:57:29 +02:00
asciinema stream -l
2024-05-07 11:18:53 +02:00
```
To stream a session via a relay (asciinema server) run:
```sh
2025-09-11 20:57:29 +02:00
asciinema stream -r
2024-05-07 11:18:53 +02:00
```
Check out the [Getting started
guide](https://docs.asciinema.org/getting-started/) for installation and usage
overview.
## Building
Building asciinema from source requires the [Rust](https://www.rust-lang.org/)
2025-09-25 18:57:04 +02:00
compiler (1.82 or later), and the [Cargo package
manager](https://doc.rust-lang.org/cargo/). If they are not available via your
system package manager then use [rustup](https://rustup.rs/).
To download the source code, build the asciinema binary, and install it in
2025-09-11 20:57:29 +02:00
`$HOME/.cargo/bin` in one go run:
```sh
cargo install --locked --git https://github.com/asciinema/asciinema
```
Then, ensure `$HOME/.cargo/bin` is in your shell's `$PATH`.
Alternatively, you can manually download the source code and build the asciinema
binary with:
```sh
git clone https://github.com/asciinema/asciinema
cd asciinema
cargo build --release
```
2025-09-11 20:57:29 +02:00
This produces the binary at `target/release/asciinema`. You can just copy the
binary to a directory in your `$PATH`.
2024-04-29 22:34:23 +02:00
2024-05-15 11:58:17 +02:00
To generate man pages and shell completion files, set `ASCIINEMA_GEN_DIR` to the
2024-04-29 22:34:23 +02:00
path where these artifacts should be stored. For example:
```sh
2024-05-15 11:58:17 +02:00
ASCIINEMA_GEN_DIR=/foo cargo build --release
2024-04-29 22:34:23 +02:00
```
2024-05-15 11:58:17 +02:00
The above command will build the binary and place the man pages in `/foo/man/`,
and the shell completion files in the `/foo/completion/` directory.
> [!NOTE]
2025-09-11 20:57:29 +02:00
> Windows is currently not supported. See [#467](https://github.com/orgs/asciinema/discussions/278).
2025-10-27 11:43:12 +01:00
> You can try [PowerSession](https://github.com/Watfaq/PowerSession-rs) instead.
## Development
2025-09-11 20:57:29 +02:00
All development happens on `develop` branch. This branch contains the current
generation (3.x) of the asciinema CLI, written in Rust.
The previous generation (2.x), written in Python, can be found in the `python`
2025-09-11 20:57:29 +02:00
branch.
If you'd like to propose or submit any changes, please read the
[contribution guidelines](CONTRIBUTING.md) first.
## Donations
Sustainability of asciinema development relies on donations and sponsorships.
2025-09-11 20:57:29 +02:00
If you like the project then consider becoming a
[supporter](https://docs.asciinema.org/donations/#individuals) or a [corporate
sponsor](https://docs.asciinema.org/donations/#corporate-sponsorship).
2023-09-19 10:07:32 +02:00
asciinema is sponsored by:
- [Brightbox](https://www.brightbox.com/)
2023-06-20 10:20:48 +02:00
## Consulting
If you're interested in integration or customization of asciinema to suit your
needs, check [asciinema consulting
services](https://docs.asciinema.org/consulting/).
2013-10-06 12:58:29 +02:00
2014-11-15 17:42:04 +01:00
## License
2013-10-06 12:58:29 +02:00
© 2011 Marcin Kulik.
2014-11-15 17:42:04 +01:00
All code is licensed under the GPL, v3 or later. See [LICENSE](./LICENSE) file
for details.