From time to time, you write something which you really want to show off. If it's a GUI application then you might start with some good screenshots, or possibly even make a screen-capture video of you using the application, so that people can watch and marvel at your amazing creation.
If your wonderful program happens to be a command-line tool, then such videos are often a little lackluster or simply overly-large for the information they convey. It's better if the text being displayed is actually text and that it can be copy-pasted out (so others can follow along in their own terminals). To that end, there is a number of tools for recording operations in a terminal and allowing that to played back. I will mention a few of them here, but this is by no means an exhaustive list; and I shall endeavour to not recommend any specific option over any other.
Asciinema
Asciinema is a pretty slick project housed at https://asciinema.org/ with its source available at https://github.com/asciinema/asciinema and https://github.com/asciinema/asciinema-player. Asciinema is available in Debian and other Linux distributions and works very well. The Asciinema community provides a hosted system and also the tooling necessary to provision the playback of recordings on your own website providing you can honour the GPLv3. The client application is written in Python and has few dependencies.
You can see an example at: https://asciinema.org/a/42383
showterm
Like Asciinema, showterm provides a hosted service, over at https://showterm.io/ and an open-source tool hosted at https://github.com/ConradIrwin/showterm. Showterm's server-side is also open, but is focussed on a hosted experience so expect to be running up a rails app if you want to host it yourself.
Showterm is written in Ruby and is under the MIT licence as is its server. It
also relies on ttyrec
in some circumstances.
You can see an example at: https://showterm.io/7b5f8d42ba021511e627e
TermRecord
If you're hoping for standalone HTML output, then TermRecord might be what you're after. It can be found at https://github.com/theonewolf/TermRecord and is written in Python. Unlike the other offerings, TermRecord produces entirely standalone output which doesn't depend on any other JavaScript or server resources.
The licence terms for the TermRecord output include MIT licensed JavaScript, and font content under the Ubuntu Font License 1.0.
You can see an example at: http://theonewolf.github.io/TermRecord/figlet-static.html
TTYGIF
The TTYGIF project deserves an honourable mention because despite its output not being copy/pasteable; an animated GIF is much smaller than a video file would likely be. TTYGIF is housed at https://github.com/icholy/ttygif and produces a simple animated GIF of the terminal it is running in. Since almost every web browser which isn't purely text-based offers animated GIF playback, the output of TTYGIF doesn't need any additional support. No JavaScript players or complex plugins.
TTYGIF is MIT licensed, but doesn't seem to place any particular licence on its output. It's also written in C and needs a few dependencies to get itself going, one of which is a tty recorder anyway
You can see an example at: https://camo.githubusercontent.com/acff4cc740350a784cb4539e501fcce1815329c0/687474703a2f2f692e696d6775722e636f6d2f6e76454854676e2e676966
Others
There are plenty of other options, including those which tend to only offer
playback in a terminal themselves, such as script
and ttyrec
. Your
homework (You didn't think you'd got away with another week without homework
did you?) is to have a play with some of the options listed here (or any
others) you can find, and then perhaps comment on this posting showing what
you've managed to get up to while creating a tty-cast to demonstrate your
latest impressive terminal skills.