HACKER Q&A
📣 yenoham

What is the best way to record a terminal session?


I am writing some documentation for our product. In it, we need to document several terminal command sequences, like what you see on this Cypress guide - https://docs.cypress.io/guides/getting-started/installing-cypress.html#npm-install

Whilst I can record it all in video, the problem I find is that you get several steps in, then make a minor typo which is in your video unless you re-record or do a bunch of editing.

It made me wonder if there are any tools that allow you to easily 'fake' the process (e.g. a web app that lets you type in the commands you want to emulate, then have those print out one after the other)?

If anyone knows of something, or can think of a better solution, that would be great!


  👤 Memosyne Accepted Answer ✓
You could try using asciinema[1].

[1] - https://github.com/asciinema/asciinema


👤 japhyr
I'm not sure if it affects your specific situation, but I'll share that mistakes in CLI demos have never bothered me. They always make me feel better about the everyday typos I make, and they make me feel like I'm watching a human interact with a system. I wouldn't want to watch a distracting number of typos when I'm learning how to use a system, but a few are perfectly acceptable.

It reminds me of listening to podcasts. The podcasts with huge budgets are sometimes overproduced. The pauses all feel dramatic and acted, and everything feels well-rehearsed. My favorite podcasts are ones that have received light editing for content, but leave in the natural flow of human conversation.


👤 elviejo
the commands: script / scriptreplay are the ones you are looking for.

Now if you also would like to reproduce the video experience you coul use: https://asciinema.org/

Wich records a your terminal session, looks like a video but is in fact text characters.


👤 jimsmart
Approaching from another angle: develop/debug a simple script containing your setup commands, possibly using Vagrant (or similar) in your cycle to test.

Then later you can make a video, perhaps using the software you've already tried (or recommended in other replies), by pasting the commands one by one from the script into the terminal.


👤 raizinho
Simple Screen Recorder is pretty good.