Posted on
Software

asciinema: Record and share terminal sessions

Author
  • User
    Linux Bash
    Posts by this author
    Posts by this author

Dive Into Terminal Magic with Asciinema: Record and Share Your Terminal Sessions like a Pro

Ever wanted to share a complex command-line process with a teammate, or demonstrate software usage in an easily accessible format? The command-line, while powerful and efficient, has often lacked the tools to easily share and demonstrate processes - until now. Enter Asciinema, an open-source tool that allows you to record terminal sessions and share them in a visually-appealing and web-friendly format.

What is Asciinema?

Asciinema is a simple yet powerful tool that runs from the command line and records all your terminal activity. It’s different from traditional screen capturing tools because it records the actual ASCII sequences and timing information to a file or streams them directly online. These recordings can be played back in any terminal that supports ASCII so that you can share your command-line work exactly as you experience it yourself.

Key Features:

  • Lightweight and Non-intrusive: No heavy videos to upload or download, just a simple JSON file format that can be embedded in web pages.

  • Copy/Paste Friendly: Viewers can copy commands directly from the playback, which is not possible from traditional video.

  • Open Source: Modify, distribute, and use it freely in personal or commercial projects.

Getting Started with Asciinema

Installation:

Asciinema can be installed on various Linux distributions using different package managers. Here’s how you can install Asciinema using apt, dnf, and zypper.

Ubuntu and Debian-based distributions:

To install Asciinema on Ubuntu or any other Debian-based system, you use apt:

sudo apt update
sudo apt install asciinema

Fedora and other DNF-based distributions:

If you are on Fedora or any distribution that supports dnf, you can use the following commands to install Asciinema:

sudo dnf makecache
sudo dnf install asciinema

openSUSE and other Zypper-based distributions:

For systems using zypper like openSUSE, use these commands:

sudo zypper refresh
sudo zypper install asciinema

Usage Guide:

Once installed, starting a recording session is as simple as typing:

asciinema rec

When you’re finished, just type exit or press Ctrl-D to end the session. The command will then give you a URL where your terminal recording has been published; you can share this link directly.

You can also save your recording to a local file:

asciinema rec demo.json

To playback the recording:

asciinema play demo.json

Sharing and Embedding Recordings

After recording, Asciinema uploads your session to its website (asciinema.org) where you can easily share it via a URL, or embed it on your blog or website using HTML code. Users can play the asciicast directly in their web browsers, pause/resume it, and even copy text from it.

Conclusion

Asciinema provides a marvelous way to capture and demonstrate terminal sessions without the overhead of video files. It’s perfect for creating tutorials, demonstrating bugs, or sharing command-line tricks with the community or team members. By using Asciinema, your demonstrations become more interactive, accessible, and valuable to your audience.

This tool empowers developers and system administrators to share their terminal wisdom and techniques in an effortlessly understandable and engaging format. Let us transform how we communicate in the tech space, making sharing our skills and snippets of wisdom simple and straightforward with Asciinema.