Terminal session recorder and the best companion of asciinema.org.
Using package manager
asciinema is available in repositories of most popular package managers on Mac
OS X, Linux and FreeBSD. Look for package named
asciinema. See the
list of available packages.
Building from source
To build asciinema from source you need to have Go development toolchain installed.
You can use
go get to fetch the source, build and install asciinema at
$GOPATH/bin/asciinema in one go:
go get github.com/asciinema/asciinema
Download the source code into your
mkdir -p $GOPATH/src/github.com/asciinema git clone https://github.com/asciinema/asciinema.git $GOPATH/src/github.com/asciinema/asciinema
Build the binary:
cd $GOPATH/src/github.com/asciinema/asciinema make build
This will produce asciinema binary at
To install it system wide (to
sudo make install
If you want to install it in other location:
PREFIX=/the/prefix make install
asciinema is composed of multiple commands, similar to
When you run
asciinema with no arguments help message is displayed, listing
all available commands with their options.
Record terminal session.
This is the single most important command in asciinema, since it is how you utilize this tool's main job.
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.
Recording finishes when you exit the shell (hit Ctrl+D or type
exit). If the recorded process is not a shell then recording finishes when
the process exits.
filename argument is given then the resulting recording (called
asciicast) is saved to a local file. It can later be
asciinema play <filename> and/or uploaded to asciinema.org with
asciinema upload <filename>. If the
filename argument is omitted then
(after asking for confirmation) the resulting asciicast is uploaded to
asciinema.org for further playback in a web browser.
ASCIINEMA_REC=1 is added to recorded process environment variables. This
can be used by your shell's config file (
.zshrc) to alter the
prompt or play a sound when shell is being recorded.
-c, --command=<command>- Specify command to record, defaults to $SHELL
-t, --title=<title>- Specify the title of the asciicast
-w, --max-wait=<sec>- Reduce recorded terminal inactivity to max seconds
-y, --yes- Answer "yes" to all prompts (e.g. upload confirmation)
-q, --quiet- Be quiet, suppress all notices/warnings (implies -y)
Replay recorded asciicast in a terminal.
This command replays given asciicast (as recorded by
rec command) directly in
Playing from a local file:
asciinema play /path/to/asciicast.json
Playing from HTTP(S) URL:
asciinema play https://asciinema.org/a/22124.json asciinema play http://example.com/demo.json
Playing from asciicast page URL (requires
<link rel="alternate" type="application/asciicast+json" href="....json"> in page's HTML):
asciinema play https://asciinema.org/a/22124 asciinema play http://example.com/blog/post.html
Playing from stdin:
cat /path/to/asciicast.json | asciinema play - ssh user@host cat asciicast.json | asciinema play -
Playing from IPFS:
asciinema play ipfs:/ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V asciinema play fs:/ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V
-w, --max-wait=<sec>- Reduce replayed terminal inactivity to max seconds
NOTE: 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.
Upload recorded asciicast to asciinema.org site.
This command uploads given asciicast (as recorded by
rec command) to
asciinema.org for further playback in a web browser.
asciinema rec demo.json +
asciinema play demo.json +
asciinema upload demo.json is a nice combo for when you want to review an asciicast before
publishing it on asciinema.org.
Assign local API token to asciinema.org account.
On every machine you install asciinema recorder, you get a new, unique API token. This command connects this local token with your asciinema.org account, and links all asciicasts recorded on this machine with the account.
This command displays the URL you should open in your web browser. If you never logged in to asciinema.org then your account will be created when opening the URL.
NOTE: it is necessary to do this if you want to edit or delete your recordings on asciinema.org.
You can synchronize your config file (which keeps the API token) across the machines but that's not necessary. You can assign new tokens to your account from as many machines as you want.
asciinema uses a config file to keep API token and user settings. In most cases
the location of this file is
When you first run
asciinema, local API token is generated and saved in the
file (unless the file already exists). It looks like this:
[api] token = d5a2dce4-173f-45b2-a405-ac33d7b70c5f
There are several options you can set in this file. Here's a config with all available options set:
[api] token = d5a2dce4-173f-45b2-a405-ac33d7b70c5f url = https://asciinema.example.com [record] command = /bin/bash -l maxwait = 2 yes = true [play] maxwait = 1
The options in
[api] section are related to API location and authentication.
To tell asciinema recorder to use your own asciinema site instance rather than
the default one (asciinema.org), you can set
url option. API URL can also be
ASCIINEMA_API_URL environment variable.
The options in
[play] sections have the same meaning as the
options you pass to
asciinema play command. If you happen to
often use either
-y with these commands then consider saving it
as a default in the config file.
Configuration file locations
In fact, the following locations are checked for the presence of the config file (in the given order):
$ASCIINEMA_CONFIG_HOME/config- if you have set
$XDG_CONFIG_HOME/asciinema/config- on Linux,
$XDG_CONFIG_HOMEusually points to
$HOME/.config/asciinema/config- in most cases it's here
$HOME/.asciinema/config- created by asciinema versions prior to 1.1
The first one which is found is used.
If you want to contribute to this project check out Contributing page.
Copyright © 2011-2016 Marcin Kulik.
All code is licensed under the GPL, v3 or later. See LICENSE file for details.
There is no documentation for this package.
Package gcfg reads "INI-style" text-based configuration files with "name=value" pairs grouped into sections (gcfg files).
|Package gcfg reads "INI-style" text-based configuration files with "name=value" pairs grouped into sections (gcfg files).|
Package scanner implements a scanner for gcfg configuration text.
|Package scanner implements a scanner for gcfg configuration text.|
Package token defines constants representing the lexical tokens of the gcfg configuration syntax and basic operations on tokens (printing, predicates).
|Package token defines constants representing the lexical tokens of the gcfg configuration syntax and basic operations on tokens (printing, predicates).|
Package types defines helpers for type conversions.
|Package types defines helpers for type conversions.|
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
|Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.|
Package docopt parses command-line arguments based on a help message.
|Package docopt parses command-line arguments based on a help message.|
Package pty provides functions for working with Unix terminals.
|Package pty provides functions for working with Unix terminals.|
Package html implements an HTML5-compliant tokenizer and parser.
|Package html implements an HTML5-compliant tokenizer and parser.|
Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id".
|Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id".|
Package charset provides common text encodings for HTML documents.
|Package charset provides common text encodings for HTML documents.|
Package encoding defines an interface for character encodings, such as Shift JIS and Windows 1252, that can convert to and from UTF-8.
|Package encoding defines an interface for character encodings, such as Shift JIS and Windows 1252, that can convert to and from UTF-8.|
Package charmap provides simple character encodings such as IBM Code Page 437 and Windows 1252.
|Package charmap provides simple character encodings such as IBM Code Page 437 and Windows 1252.|
Package htmlindex maps character set encoding names to Encodings as recommended by the W3C for use in HTML 5.
|Package htmlindex maps character set encoding names to Encodings as recommended by the W3C for use in HTML 5.|
Package ianaindex maps names to Encodings as specified by the IANA registry.
|Package ianaindex maps names to Encodings as specified by the IANA registry.|
Package japanese provides Japanese encodings such as EUC-JP and Shift JIS.
|Package japanese provides Japanese encodings such as EUC-JP and Shift JIS.|
Package korean provides Korean encodings such as EUC-KR.
|Package korean provides Korean encodings such as EUC-KR.|
Package simplifiedchinese provides Simplified Chinese encodings such as GBK.
|Package simplifiedchinese provides Simplified Chinese encodings such as GBK.|
Package traditionalchinese provides Traditional Chinese encodings such as Big5.
|Package traditionalchinese provides Traditional Chinese encodings such as Big5.|
Package unicode provides Unicode encodings such as UTF-16.
|Package unicode provides Unicode encodings such as UTF-16.|
Package runes provide transforms for UTF-8 encoded text.
|Package runes provide transforms for UTF-8 encoded text.|
Package transform provides reader and writer wrappers that transform the bytes passing through as well as various transformations.
|Package transform provides reader and writer wrappers that transform the bytes passing through as well as various transformations.|