2015-03-06 11:59:27 +01:00
|
|
|
|
# asciinema
|
2013-10-03 17:57:40 +02:00
|
|
|
|
|
2021-10-02 16:44:28 +02:00
|
|
|
|
[](https://github.com/asciinema/asciinema/actions/workflows/asciinema.yml)
|
2017-09-16 11:08:32 +02:00
|
|
|
|
[](https://pypi.org/project/asciinema/)
|
2015-08-07 17:04:55 -04:00
|
|
|
|
[](https://raw.githubusercontent.com/asciinema/asciinema/master/LICENSE)
|
2013-10-03 17:57:40 +02:00
|
|
|
|
|
2015-03-06 11:59:27 +01:00
|
|
|
|
Terminal session recorder and the best companion of
|
|
|
|
|
|
[asciinema.org](https://asciinema.org).
|
2013-10-03 17:57:40 +02:00
|
|
|
|
|
2020-12-28 12:32:12 +01:00
|
|
|
|
[](https://asciinema.org/a/335480?autoplay=1)
|
2015-03-28 17:56:20 +01:00
|
|
|
|
|
2017-11-18 22:09:15 +01:00
|
|
|
|
## Quick intro
|
|
|
|
|
|
|
2017-11-18 22:39:55 +01:00
|
|
|
|
asciinema lets you easily record terminal sessions and replay
|
|
|
|
|
|
them in a terminal as well as in a web browser.
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
2021-12-11 23:14:34 +01:00
|
|
|
|
Install latest version ([other installation options](#installation))
|
|
|
|
|
|
using [pipx](https://pypa.github.io/pipx/) (if you have it):
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
2022-02-12 15:53:53 -05:00
|
|
|
|
pipx install asciinema
|
|
|
|
|
|
```
|
2021-12-11 23:14:34 +01:00
|
|
|
|
|
|
|
|
|
|
If you don't have pipx, install using pip with your preferred Python version:
|
|
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
```sh
|
|
|
|
|
|
python3 -m pip install asciinema
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
|
|
|
|
|
Record your first session:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema rec first.cast
|
|
|
|
|
|
```
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
|
|
|
|
|
Now replay it with double speed:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema play -s 2 first.cast
|
|
|
|
|
|
```
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
|
|
|
|
|
Or with normal speed but with idle time limited to 2 seconds:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema play -i 2 first.cast
|
|
|
|
|
|
```
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
2017-11-18 22:39:55 +01:00
|
|
|
|
You can pass `-i 2` to `asciinema rec` as well, to set it permanently on a
|
2017-11-18 22:09:15 +01:00
|
|
|
|
recording. Idle time limiting makes the recordings much more interesting to
|
2018-07-05 10:10:36 -07:00
|
|
|
|
watch. Try it.
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
2017-11-18 22:39:55 +01:00
|
|
|
|
If you want to watch and share it on the web, upload it:
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema upload first.cast
|
|
|
|
|
|
```
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
|
|
|
|
|
The above uploads it to [asciinema.org](https://asciinema.org), which is a
|
|
|
|
|
|
default [asciinema-server](https://github.com/asciinema/asciinema-server)
|
|
|
|
|
|
instance, and prints a secret link you can use to watch your recording in a web
|
|
|
|
|
|
browser.
|
|
|
|
|
|
|
|
|
|
|
|
You can record and upload in one step by omitting the filename:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema rec
|
|
|
|
|
|
```
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
2018-07-05 10:10:36 -07:00
|
|
|
|
You'll be asked to confirm the upload when the recording is done. Nothing is
|
2017-11-18 22:39:55 +01:00
|
|
|
|
sent anywhere without your consent.
|
2017-11-18 22:09:15 +01:00
|
|
|
|
|
2018-07-05 10:10:36 -07:00
|
|
|
|
These are the basics, but there's much more you can do. The following sections
|
2017-11-18 22:09:15 +01:00
|
|
|
|
cover installation, usage and hosting of the recordings in more detail.
|
|
|
|
|
|
|
2013-10-03 17:57:40 +02:00
|
|
|
|
## Installation
|
|
|
|
|
|
|
2021-12-11 23:14:34 +01:00
|
|
|
|
### Python package from PyPI
|
2017-09-16 21:17:19 +02:00
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
[pypi]: https://pypi.python.org/pypi/asciinema
|
2017-09-16 21:17:19 +02:00
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
asciinema is available on [PyPI] and can be installed with
|
|
|
|
|
|
[pipx](https://pypa.github.io/pipx/) (if you have it) or with pip (Python 3
|
|
|
|
|
|
with setuptools required):
|
2017-09-16 21:17:19 +02:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
2022-02-12 15:53:53 -05:00
|
|
|
|
pipx install asciinema
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```
|
2017-09-16 21:17:19 +02:00
|
|
|
|
|
2021-12-11 23:14:34 +01:00
|
|
|
|
Or with pip (using your preferred Python version):
|
2017-09-16 21:17:19 +02:00
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
```sh
|
|
|
|
|
|
python3 -m pip install asciinema
|
|
|
|
|
|
```
|
2017-09-16 21:17:19 +02:00
|
|
|
|
|
2021-12-11 23:14:34 +01:00
|
|
|
|
Installing from [PyPI] is the recommended way of installation, which gives you the latest released version.
|
2017-09-16 21:17:19 +02:00
|
|
|
|
|
2016-07-05 17:29:33 +02:00
|
|
|
|
### Native packages
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2016-07-05 17:29:33 +02:00
|
|
|
|
asciinema is included in repositories of most popular package managers on Mac OS
|
|
|
|
|
|
X, Linux and FreeBSD. Look for package named `asciinema`. See the
|
2015-07-01 20:20:07 +02:00
|
|
|
|
[list of available packages](https://asciinema.org/docs/installation).
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2017-09-22 20:59:47 +02:00
|
|
|
|
### Running latest version from source code checkout
|
|
|
|
|
|
|
2019-01-12 20:08:02 +01:00
|
|
|
|
If you can't use Python package or native package for your OS is outdated you
|
|
|
|
|
|
can clone the repo and run asciinema straight from the checkout.
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2017-09-22 20:59:47 +02:00
|
|
|
|
Clone the repo:
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
git clone https://github.com/asciinema/asciinema.git
|
|
|
|
|
|
cd asciinema
|
|
|
|
|
|
```
|
2017-09-22 20:59:47 +02:00
|
|
|
|
|
|
|
|
|
|
If you want latest stable version:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
git checkout master
|
|
|
|
|
|
```
|
2017-09-22 20:59:47 +02:00
|
|
|
|
|
|
|
|
|
|
If you want current development version:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
git checkout develop
|
|
|
|
|
|
```
|
2017-09-22 20:59:47 +02:00
|
|
|
|
|
|
|
|
|
|
Then run it with:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
python3 -m asciinema --version
|
|
|
|
|
|
```
|
2014-12-18 12:05:44 +01:00
|
|
|
|
|
2017-04-12 14:01:17 +02:00
|
|
|
|
### Docker image
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
asciinema Docker image is based on [Ubuntu
|
|
|
|
|
|
20.04](https://releases.ubuntu.com/20.04/) and has the latest version of
|
2017-04-12 14:01:17 +02:00
|
|
|
|
asciinema recorder pre-installed.
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
docker pull docker.io/asciinema/asciinema
|
|
|
|
|
|
```
|
2017-04-12 14:01:17 +02:00
|
|
|
|
|
|
|
|
|
|
When running it don't forget to allocate a pseudo-TTY (`-t`), keep STDIN open
|
|
|
|
|
|
(`-i`) and mount config directory volume (`-v`):
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
docker run --rm -it -v "${HOME}/.config/asciinema:/root/.config/asciinema" docker.io/asciinema/asciinema rec
|
|
|
|
|
|
```
|
2017-04-12 14:01:17 +02:00
|
|
|
|
|
2019-01-12 20:33:08 +01:00
|
|
|
|
Container's entrypoint is set to `/usr/local/bin/asciinema` so you can run the
|
|
|
|
|
|
container with any arguments you would normally pass to `asciinema` binary (see
|
|
|
|
|
|
Usage section for commands and options).
|
2017-04-12 14:01:17 +02:00
|
|
|
|
|
|
|
|
|
|
There's not much software installed in this image though. In most cases you may
|
|
|
|
|
|
want to install extra programs before recording. One option is to derive new
|
2022-02-12 15:53:53 -05:00
|
|
|
|
image from this one (start your custom Dockerfile with `FROM asciinema/asciinema`). Another option is to start the container with `/bin/bash`
|
2019-01-12 20:33:08 +01:00
|
|
|
|
as the entrypoint, install extra packages and manually start `asciinema rec`:
|
2017-04-12 14:01:17 +02:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```console
|
|
|
|
|
|
docker run --rm -it -v "${HOME}/.config/asciinema:/root/.config/asciinema" --entrypoint=/bin/bash docker.io/asciinema/asciinema rec
|
|
|
|
|
|
root@6689517d99a1:~# apt-get install foobar
|
|
|
|
|
|
root@6689517d99a1:~# asciinema rec
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
It is also possible to run the docker container as a non-root user, which has
|
|
|
|
|
|
security benefits. You can specify a user and group id at runtime to give the
|
|
|
|
|
|
application permission similar to the calling user on your host.
|
|
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
docker run --rm -it \
|
|
|
|
|
|
--env=ASCIINEMA_CONFIG_HOME="/run/user/$(id -u)/.config/asciinema" \
|
|
|
|
|
|
--user="$(id -u):$(id -g)" \
|
|
|
|
|
|
--volume="${HOME}/.config/asciinema:/run/user/$(id -u)/.config/asciinema:rw" \
|
|
|
|
|
|
--volume="${PWD}:/data:rw" \
|
|
|
|
|
|
--workdir='/data' \
|
|
|
|
|
|
docker.io/asciinema/asciinema rec
|
|
|
|
|
|
```
|
2017-04-12 14:01:17 +02:00
|
|
|
|
|
2013-10-03 17:57:40 +02:00
|
|
|
|
## Usage
|
|
|
|
|
|
|
2015-08-08 21:25:11 +02:00
|
|
|
|
asciinema is composed of multiple commands, similar to `git`, `apt-get` or
|
2015-03-05 15:29:17 +01:00
|
|
|
|
`brew`.
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2015-08-08 21:25:11 +02:00
|
|
|
|
When you run `asciinema` with no arguments help message is displayed, listing
|
2015-03-05 15:29:17 +01:00
|
|
|
|
all available commands with their options.
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2015-02-24 17:51:40 +01:00
|
|
|
|
### `rec [filename]`
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
**Record terminal session.**
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2015-02-24 17:51:40 +01:00
|
|
|
|
By running `asciinema rec [filename]` you start a new recording session. The
|
|
|
|
|
|
command (process) that is recorded can be specified with `-c` option (see
|
|
|
|
|
|
below), and defaults to `$SHELL` which is what you want in most cases.
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2021-10-02 21:38:19 +02:00
|
|
|
|
You can temporarily pause the capture of your terminal by pressing
|
2021-10-02 21:46:30 +02:00
|
|
|
|
<kbd>Ctrl+\\</kbd>. This is useful when you want to execute some commands during
|
2021-10-02 21:38:19 +02:00
|
|
|
|
the recording session that should not be captured (e.g. pasting secrets). Resume
|
2021-10-02 21:46:30 +02:00
|
|
|
|
by pressing <kbd>Ctrl+\\</kbd> again. When pausing desktop notification is
|
2021-10-02 21:38:19 +02:00
|
|
|
|
displayed so you're sure the sensitive output won't be captured in the
|
|
|
|
|
|
recording.
|
2019-03-17 15:02:15 +01:00
|
|
|
|
|
2014-12-17 16:23:15 +01:00
|
|
|
|
Recording finishes when you exit the shell (hit <kbd>Ctrl+D</kbd> or type
|
2015-02-24 17:51:40 +01:00
|
|
|
|
`exit`). If the recorded process is not a shell then recording finishes when
|
2014-12-17 16:23:15 +01:00
|
|
|
|
the process exits.
|
|
|
|
|
|
|
2017-09-22 22:59:14 +02:00
|
|
|
|
If the `filename` argument is omitted then (after asking for confirmation) the
|
|
|
|
|
|
resulting asciicast is uploaded to
|
|
|
|
|
|
[asciinema-server](https://github.com/asciinema/asciinema-server) (by default to
|
|
|
|
|
|
asciinema.org), where it can be watched and shared.
|
|
|
|
|
|
|
|
|
|
|
|
If the `filename` argument is given then the resulting recording (called
|
|
|
|
|
|
[asciicast](doc/asciicast-v2.md)) is saved to a local file. It can later be
|
|
|
|
|
|
replayed with `asciinema play <filename>` and/or uploaded to asciinema server
|
|
|
|
|
|
with `asciinema upload <filename>`.
|
2015-02-24 17:51:40 +01:00
|
|
|
|
|
2014-12-17 16:23:15 +01:00
|
|
|
|
`ASCIINEMA_REC=1` is added to recorded process environment variables. This
|
|
|
|
|
|
can be used by your shell's config file (`.bashrc`, `.zshrc`) to alter the
|
2017-09-22 22:59:14 +02:00
|
|
|
|
prompt or play a sound when the shell is being recorded.
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
|
|
|
|
|
Available options:
|
|
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
- `--stdin` - Enable stdin (keyboard) recording (see below)
|
|
|
|
|
|
- `--append` - Append to existing recording
|
|
|
|
|
|
- `--raw` - Save raw STDOUT output, without timing information or other metadata
|
|
|
|
|
|
- `--overwrite` - Overwrite the recording if it already exists
|
|
|
|
|
|
- `-c, --command=<command>` - Specify command to record, defaults to $SHELL
|
|
|
|
|
|
- `-e, --env=<var-names>` - List of environment variables to capture, defaults
|
2017-11-19 18:29:20 +01:00
|
|
|
|
to `SHELL,TERM`
|
2022-02-12 15:53:53 -05:00
|
|
|
|
- `-t, --title=<title>` - Specify the title of the asciicast
|
|
|
|
|
|
- `-i, --idle-time-limit=<sec>` - Limit recorded terminal inactivity to max `<sec>` seconds
|
2022-02-16 23:01:15 +01:00
|
|
|
|
- `--cols=<n>` - Override terminal columns for recorded process
|
|
|
|
|
|
- `--rows=<n>` - Override terminal rows for recorded process
|
2022-02-12 15:53:53 -05:00
|
|
|
|
- `-y, --yes` - Answer "yes" to all prompts (e.g. upload confirmation)
|
|
|
|
|
|
- `-q, --quiet` - Be quiet, suppress all notices/warnings (implies -y)
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2017-09-22 23:20:21 +02:00
|
|
|
|
Stdin recording allows for capturing of all characters typed in by the user in
|
|
|
|
|
|
the currently recorded shell. This may be used by a player (e.g.
|
|
|
|
|
|
[asciinema-player](https://github.com/asciinema/asciinema-player)) to display
|
2022-05-14 14:12:16 +02:00
|
|
|
|
pressed keys. Because it's basically key-logging (scoped to a single shell
|
2017-10-08 19:47:33 +02:00
|
|
|
|
instance), it's disabled by default, and has to be explicitly enabled via
|
|
|
|
|
|
`--stdin` option.
|
2017-09-22 23:20:21 +02:00
|
|
|
|
|
2015-02-24 17:51:40 +01:00
|
|
|
|
### `play <filename>`
|
|
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
**Replay recorded asciicast in a terminal.**
|
2015-02-24 17:51:40 +01:00
|
|
|
|
|
|
|
|
|
|
This command replays given asciicast (as recorded by `rec` command) directly in
|
|
|
|
|
|
your terminal.
|
|
|
|
|
|
|
2021-10-02 20:58:24 +02:00
|
|
|
|
Following keyboard shortcuts are available by default:
|
2017-11-26 00:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
- <kbd>Space</kbd> - toggle pause,
|
|
|
|
|
|
- <kbd>.</kbd> - step through a recording a frame at a time (when paused),
|
|
|
|
|
|
- <kbd>Ctrl+C</kbd> - exit.
|
|
|
|
|
|
|
2021-10-02 20:58:24 +02:00
|
|
|
|
See "Configuration file" section for information on how to customize the
|
|
|
|
|
|
keyboard shortcuts.
|
|
|
|
|
|
|
2016-02-21 12:09:33 +01:00
|
|
|
|
Playing from a local file:
|
2015-06-23 20:20:22 +02:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema play /path/to/asciicast.cast
|
|
|
|
|
|
```
|
2016-02-21 12:09:33 +01:00
|
|
|
|
|
2016-02-21 20:24:20 +01:00
|
|
|
|
Playing from HTTP(S) URL:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema play https://asciinema.org/a/22124.cast
|
|
|
|
|
|
asciinema play http://example.com/demo.cast
|
|
|
|
|
|
```
|
2016-02-21 20:24:20 +01:00
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
Playing from asciicast page URL (requires `<link rel="alternate" type="application/x-asciicast" href="/my/ascii.cast">` in page's HTML):
|
2016-02-21 12:09:33 +01:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema play https://asciinema.org/a/22124
|
|
|
|
|
|
asciinema play http://example.com/blog/post.html
|
|
|
|
|
|
```
|
2016-02-21 12:09:33 +01:00
|
|
|
|
|
|
|
|
|
|
Playing from stdin:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
cat /path/to/asciicast.cast | asciinema play -
|
|
|
|
|
|
ssh user@host cat asciicast.cast | asciinema play -
|
|
|
|
|
|
```
|
2015-06-23 20:20:22 +02:00
|
|
|
|
|
2016-02-21 20:23:00 +01:00
|
|
|
|
Playing from IPFS:
|
|
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
```sh
|
|
|
|
|
|
asciinema play dweb:/ipfs/QmNe7FsYaHc9SaDEAEXbaagAzNw9cH7YbzN4xV7jV1MCzK/ascii.cast
|
|
|
|
|
|
```
|
2016-02-21 20:23:00 +01:00
|
|
|
|
|
2015-05-10 13:53:04 +02:00
|
|
|
|
Available options:
|
|
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
- `-i, --idle-time-limit=<sec>` - Limit replayed terminal inactivity to max `<sec>` seconds
|
|
|
|
|
|
- `-s, --speed=<factor>` - Playback speed (can be fractional)
|
2022-05-15 19:00:29 +02:00
|
|
|
|
- `-l, --loop` - Play in a loop
|
2022-05-14 18:10:15 +02:00
|
|
|
|
- `--stream=<stream>` - Select stream to play (see below)
|
|
|
|
|
|
- `--out-fmt=<format>` - Select output format (see below)
|
2022-05-14 14:12:16 +02:00
|
|
|
|
|
|
|
|
|
|
By default the output stream (`o`) is played. This is what you want in most
|
|
|
|
|
|
cases. If you recorded the input stream (`i`) with `asciinema rec --stdin` then
|
|
|
|
|
|
you can replay it with `asciinema play --stream=i <filename>`.
|
2015-05-10 13:53:04 +02:00
|
|
|
|
|
2022-05-14 18:10:15 +02:00
|
|
|
|
By default the selected stream is written to stdout in original, raw data form.
|
|
|
|
|
|
This is also what you want in majority of cases. However you can change the
|
|
|
|
|
|
output format to asciicast (newline delimited JSON) with `asciinema play
|
|
|
|
|
|
--out-fmt=asciicast <filename>`. This allows delegating actual rendering to
|
|
|
|
|
|
another place (e.g. outside of your terminal) by piping output of `asciinema
|
|
|
|
|
|
play` to a tool of your choice.
|
|
|
|
|
|
|
2017-11-19 18:29:50 +01:00
|
|
|
|
> For the best playback experience it is recommended to run `asciinema play` in
|
|
|
|
|
|
> a terminal of dimensions not smaller than the one used for recording, as
|
|
|
|
|
|
> there's no "transcoding" of control sequences for new terminal size.
|
2015-10-21 11:20:26 +02:00
|
|
|
|
|
2017-11-18 16:57:13 +01:00
|
|
|
|
### `cat <filename>`
|
|
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
**Print full output of recorded asciicast to a terminal.**
|
2015-05-10 13:53:04 +02:00
|
|
|
|
|
2017-11-18 16:57:13 +01:00
|
|
|
|
While `asciinema play <filename>` replays the recorded session using timing
|
|
|
|
|
|
information saved in the asciicast, `asciinema cat <filename>` dumps the full
|
|
|
|
|
|
output (including all escape sequences) to a terminal immediately.
|
|
|
|
|
|
|
2017-11-18 21:16:24 +01:00
|
|
|
|
`asciinema cat existing.cast >output.txt` gives the same result as recording via
|
|
|
|
|
|
`asciinema rec --raw output.txt`.
|
2015-10-21 11:20:26 +02:00
|
|
|
|
|
2015-02-24 17:51:40 +01:00
|
|
|
|
### `upload <filename>`
|
|
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
**Upload recorded asciicast to asciinema.org site.**
|
2015-02-24 17:51:40 +01:00
|
|
|
|
|
2018-02-05 21:40:37 +01:00
|
|
|
|
This command uploads given asciicast (recorded by `rec` command) to
|
2017-09-18 09:10:34 +02:00
|
|
|
|
asciinema.org, where it can be watched and shared.
|
2015-02-24 17:51:40 +01:00
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
`asciinema rec demo.cast` + `asciinema play demo.cast` + `asciinema upload demo.cast` is a nice combo if you want to review an asciicast before
|
2015-02-25 16:24:15 +01:00
|
|
|
|
publishing it on asciinema.org.
|
2015-02-24 17:51:40 +01:00
|
|
|
|
|
2014-12-17 16:23:15 +01:00
|
|
|
|
### `auth`
|
|
|
|
|
|
|
2022-02-12 15:53:53 -05:00
|
|
|
|
**Link your install ID with your asciinema.org user account.**
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
If you want to manage your recordings (change title/theme, delete) at
|
|
|
|
|
|
asciinema.org you need to link your "install ID" with asciinema.org user
|
|
|
|
|
|
account.
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
This command displays the URL to open in a web browser to do that. You may be
|
|
|
|
|
|
asked to log in first.
|
2014-12-17 16:23:15 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
Install ID is a random ID ([UUID
|
|
|
|
|
|
v4](https://en.wikipedia.org/wiki/Universally_unique_identifier)) generated
|
|
|
|
|
|
locally when you run asciinema for the first time, and saved at
|
2019-04-09 14:09:11 -04:00
|
|
|
|
`$HOME/.config/asciinema/install-id`. Its purpose is to connect local machine
|
2017-12-04 00:25:50 +01:00
|
|
|
|
with uploaded recordings, so they can later be associated with asciinema.org
|
|
|
|
|
|
account. This way we decouple uploading from account creation, allowing them to
|
|
|
|
|
|
happen in any order.
|
2013-10-03 17:57:40 +02:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
> A new install ID is generated on each machine and system user account you use
|
|
|
|
|
|
> asciinema on, so in order to keep all recordings under a single asciinema.org
|
|
|
|
|
|
> account you need to run `asciinema auth` on all of those machines.
|
|
|
|
|
|
|
|
|
|
|
|
> asciinema versions prior to 2.0 confusingly referred to install ID as "API
|
|
|
|
|
|
> token".
|
2013-10-03 17:57:40 +02:00
|
|
|
|
|
2017-01-28 14:02:54 +01:00
|
|
|
|
## Hosting the recordings on the web
|
|
|
|
|
|
|
2017-09-16 11:09:02 +02:00
|
|
|
|
As mentioned in the `Usage > rec` section above, if the `filename` argument to
|
2017-11-18 21:26:09 +01:00
|
|
|
|
`asciinema rec` is omitted then the recorded asciicast is uploaded to
|
|
|
|
|
|
[asciinema.org](https://asciinema.org). You can watch it there and share it via
|
|
|
|
|
|
secret URL.
|
|
|
|
|
|
|
|
|
|
|
|
If you prefer to host the recordings yourself, you can do so by either:
|
2017-01-28 14:02:54 +01:00
|
|
|
|
|
2017-11-18 21:26:09 +01:00
|
|
|
|
- recording to a file (`asciinema rec demo.cast`), and using [asciinema's
|
|
|
|
|
|
standalone web
|
|
|
|
|
|
player](https://github.com/asciinema/asciinema-player#self-hosting-quick-start)
|
|
|
|
|
|
in your HTML page, or
|
|
|
|
|
|
- setting up your own
|
|
|
|
|
|
[asciinema-server](https://github.com/asciinema/asciinema-server) instance,
|
|
|
|
|
|
and [setting API URL
|
2021-01-03 18:58:24 +01:00
|
|
|
|
accordingly](https://github.com/asciinema/asciinema-server/wiki/Installation-guide#using-asciinema-recorder-with-your-instance).
|
2017-01-28 14:02:54 +01:00
|
|
|
|
|
2015-03-09 17:05:14 +01:00
|
|
|
|
## Configuration file
|
|
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
You can configure asciinema by creating config file at
|
|
|
|
|
|
`$HOME/.config/asciinema/config`.
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
Configuration is split into sections (`[api]`, `[record]`, `[play]`). Here's a
|
|
|
|
|
|
list of all available options for each section:
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-11-19 18:29:50 +01:00
|
|
|
|
```ini
|
|
|
|
|
|
[api]
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-11-19 18:29:50 +01:00
|
|
|
|
; API server URL, default: https://asciinema.org
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; If you run your own instance of asciinema-server then set its address here
|
|
|
|
|
|
; It can also be overriden by setting ASCIINEMA_API_URL environment variable
|
2017-11-19 18:29:50 +01:00
|
|
|
|
url = https://asciinema.example.com
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-11-19 18:29:50 +01:00
|
|
|
|
[record]
|
2015-05-24 12:29:58 +02:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; Command to record, default: $SHELL
|
2017-11-19 18:29:50 +01:00
|
|
|
|
command = /bin/bash -l
|
2016-07-05 17:29:33 +02:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; Enable stdin (keyboard) recording, default: no
|
2017-11-19 18:29:50 +01:00
|
|
|
|
stdin = yes
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; List of environment variables to capture, default: SHELL,TERM
|
2017-11-19 18:29:50 +01:00
|
|
|
|
env = SHELL,TERM,USER
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; Limit recorded terminal inactivity to max n seconds, default: off
|
2017-11-19 18:29:50 +01:00
|
|
|
|
idle_time_limit = 2
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; Answer "yes" to all interactive prompts, default: no
|
2017-11-19 18:29:50 +01:00
|
|
|
|
yes = true
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; Be quiet, suppress all notices/warnings, default: no
|
2017-11-19 18:29:50 +01:00
|
|
|
|
quiet = true
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2020-04-19 18:53:13 +02:00
|
|
|
|
; Define hotkey for pausing recording (suspending capture of output),
|
2021-10-02 20:58:24 +02:00
|
|
|
|
; default: C-\ (control + backslash)
|
2020-04-19 18:53:13 +02:00
|
|
|
|
pause_key = C-p
|
|
|
|
|
|
|
|
|
|
|
|
; Define hotkey prefix key - when defined other recording hotkeys must
|
|
|
|
|
|
; be preceeded by it, default: no prefix
|
|
|
|
|
|
prefix_key = C-a
|
|
|
|
|
|
|
2017-11-19 18:29:50 +01:00
|
|
|
|
[play]
|
2015-05-10 13:53:04 +02:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; Playback speed (can be fractional), default: 1
|
2017-11-19 18:29:50 +01:00
|
|
|
|
speed = 2
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
; Limit replayed terminal inactivity to max n seconds, default: off
|
2017-11-19 18:29:50 +01:00
|
|
|
|
idle_time_limit = 1
|
2019-03-31 18:38:00 +02:00
|
|
|
|
|
2020-04-19 19:08:39 +02:00
|
|
|
|
; Define hotkey for pausing/resuming playback,
|
|
|
|
|
|
; default: space
|
|
|
|
|
|
pause_key = p
|
|
|
|
|
|
|
|
|
|
|
|
; Define hotkey for stepping through playback, a frame at a time,
|
|
|
|
|
|
; default: .
|
2021-10-02 20:58:24 +02:00
|
|
|
|
step_key = ]
|
2020-04-19 19:08:39 +02:00
|
|
|
|
|
2019-03-31 18:38:00 +02:00
|
|
|
|
[notifications]
|
2021-10-02 21:12:35 +02:00
|
|
|
|
; Desktop notifications are displayed on certain occasions, e.g. when
|
|
|
|
|
|
; pausing/resuming the capture of terminal with C-\ keyboard shortcut.
|
2019-03-31 18:38:00 +02:00
|
|
|
|
|
|
|
|
|
|
; Should desktop notifications be enabled, default: yes
|
|
|
|
|
|
enabled = no
|
|
|
|
|
|
|
|
|
|
|
|
; Custom notification command
|
2021-10-02 21:12:35 +02:00
|
|
|
|
; asciinema automatically detects available desktop notification system
|
|
|
|
|
|
; (notify-send on GNU/Linux, osacript/terminal-notifier on macOS). Custom
|
|
|
|
|
|
; command can be used if needed.
|
|
|
|
|
|
; When invoked, environment variable $TEXT contains notification text, while
|
|
|
|
|
|
; $ICON_PATH contains path to the asciinema logo image.
|
2019-03-31 18:38:00 +02:00
|
|
|
|
command = tmux display-message "$TEXT"
|
2017-11-19 18:29:50 +01:00
|
|
|
|
```
|
2015-03-09 17:05:14 +01:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
A very minimal config file could look like that:
|
2017-04-11 17:44:43 +02:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
```ini
|
|
|
|
|
|
[record]
|
|
|
|
|
|
idle_time_limit = 2
|
|
|
|
|
|
```
|
2015-05-24 12:29:58 +02:00
|
|
|
|
|
2018-02-05 21:40:37 +01:00
|
|
|
|
Config directory location can be changed by setting `$ASCIINEMA_CONFIG_HOME`
|
|
|
|
|
|
environment variable.
|
2015-05-24 12:29:58 +02:00
|
|
|
|
|
2017-12-04 00:25:50 +01:00
|
|
|
|
If `$XDG_CONFIG_HOME` is set on Linux then asciinema uses
|
2018-02-06 18:41:58 +01:00
|
|
|
|
`$XDG_CONFIG_HOME/asciinema` instead of `$HOME/.config/asciinema`.
|
2015-05-24 12:29:58 +02:00
|
|
|
|
|
2018-02-06 18:41:58 +01:00
|
|
|
|
> asciinema versions prior to 1.1 used `$HOME/.asciinema`. If you have it
|
2017-12-04 00:25:50 +01:00
|
|
|
|
> there you should `mv $HOME/.asciinema $HOME/.config/asciinema`.
|
2015-05-24 12:29:58 +02:00
|
|
|
|
|
2013-12-03 20:15:47 +01:00
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
|
|
|
|
If you want to contribute to this project check out
|
2014-02-09 14:05:55 +01:00
|
|
|
|
[Contributing](https://asciinema.org/contributing) page.
|
2013-12-03 20:15:47 +01:00
|
|
|
|
|
2013-10-06 12:58:29 +02:00
|
|
|
|
## Authors
|
2013-10-03 17:57:40 +02:00
|
|
|
|
|
2013-10-06 12:58:29 +02:00
|
|
|
|
Developed with passion by [Marcin Kulik](http://ku1ik.com) and great open
|
2018-10-21 03:45:39 +02:00
|
|
|
|
source [contributors](https://github.com/asciinema/asciinema/contributors).
|
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
|
|
|
|
|
2021-10-02 20:24:10 +02:00
|
|
|
|
Copyright © 2011–2021 Marcin Kulik.
|
2014-11-15 17:42:04 +01:00
|
|
|
|
|
2021-10-30 12:45:23 -04:00
|
|
|
|
All code is licensed under the GPL, v3 or later. See [LICENSE](./LICENSE) file
|
|
|
|
|
|
for details.
|