Asciinema – Record and share terminal sessions
asciinema.org
asciinema.org
from the man page:
script makes a typescript of everything displayed on your ter‐
minal. It is useful for students who need a hardcopy record of
an interactive session as proof of an assignment, as the type‐
script file can be printed out later with lpr(1).You can't really use it to replay things because you can't regulate the symbol speed easily. Its not very helpful for its stated purpose because it maintains every keystroke in-stream, making normal typo corrections visible and confusing. And it's certainly not very share-able or stream-able.
The downside is that the recording format is a bit of a mess and that you end up having to hand tweak things a lot in order to make the recordings pretty. I wish the tool had more in the way of cleaning up its own recordings so that wasn't necessary. There's a small cottage industry of tools on github around this, but none of them were exceptional enough to warrant a note here.
[1]: https://github.com/asciinema/asciinema/blob/master/doc/ascii...
On the surface this looks just like what's needed to make this work for me: I like the recording tools, but don't want to be forced to embed a player from a third party service.
Looks like asciinema2gif relies on PhantomJs which brings withit an entire browser and is also no longer maintained. This looks very bloaty for a tool that should convert terminal input to a gif file.
Is it working relieably and reasonably fast?
Users might not even think about the security risks this could create. From an enterprise security perspective this is indistinguishable from any (malicious) data-exfiltration tool. It should come with a giant warning and better defaults imo.
It's not that bad, if you do not provide a filename, by default it asks for confirmation before uploading. It's still easy to upload by accident[1] though, which I know is no-go in some environment.
Oh, heaven's no! Someone might at some point try to make money from a thing they made?! From their own labor?! How awful!
Seriously: it's a stupendous tool and great service, provided free of charge and totally open source. Must we complain about the fact that they try to nudge you towards their tracking-free website, so you can see the tiny "Sponsored by Brightbox" rectangle in the footer, so that the project might yield some tiny financial return (though almost certainly not anywhere close to development costs)?
It seems to me that they've done absolutely everything right except possibly live up to the standard that apparently all open source tools should be developed by starving ascetic monks. Come on.
NET: Folks could add to the corpus following the modular syntax and issue a PR. About 3-5 minutes later, comments on the PR stream would have an animated svg/gif generated and added by the bot for review. If you liked how it looked, you accepted the PR. This corpus could then grow and be updated with minimal effort. A version of the client was modded to support self-signed certs and block accidental public upload. We ported asciinema to a helm chart that could run multiple versions on a k8s cluster per ingress path to complete the story. The whole apparatus existed entirely behind the firewall.
$ expect_command='
log_user 0
spawn bash
interact timeout 1 return
send "ps aux | rg asciinema\n"
interact timeout 3 return
exit
'
$ asciinema rec somefile -c 'expect -c '\'"$expect_command"\'
using interact timeout as a sort of checkpoint to show output, though if you want to send single quotes you'll have to make sure they get escaped in the inner command (or just have the script in a file for expect to read)It's a single binary (as cross platform as golang gets), which records a terminal session into a single html file which you can open for playback in the browser.
Any feedback is very much welcome :)
https://github.com/asciinema/vt/blob/master/src/asciinema/vt...
It's cljc, which means it runs on both JVM and in JS. I have no idea if they actually use the JVM bit.
Our business!"
I don't know how to interpret this now.
But yeah, I can't get past the name; for this very reason.
https://news.ycombinator.com/item?id=16409429
Related from 2016: https://news.ycombinator.com/item?id=12090020
Three from 2015: https://news.ycombinator.com/item?id=10398635
https://news.ycombinator.com/item?id=9753537
https://news.ycombinator.com/item?id=9072218
First posted in 2013, getting a single dismissive response: https://news.ycombinator.com/item?id=6556106
Lots more with few comments: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
This fancy players:
- are unfriendly to visually impaired people
- are unfriendly to the many people with low bandwith in the global south
- require you to watch the play instead of scanning through text with your eyes
- cannot be searched for text strings easily
- cannot be easily used in a terminal or without a browser
A short asciinema replay can be useful for a quick demo buy don't let that substitute your text documentation. I may watch the replay only once but I will come back to a well written documentation again and again.
I think it makes sense in this case because one terminal "speaks" to another. I agree with your assessment about plain text - do you think there is a good way to present this kind of workflow using plain text?
Can you tell me if your text browser/Braille reader works well with https://github.com/csdvrx/pg_csdvrx/blob/master/pg_csdvrx.tt... ?
This is my latest recording. I removed color and unicode to be more accessible but I still have some Ansi.
You do understand this is a false dichotomy? You can have both. Some people would rather watch a video and follow along, whereas others get more out of reading text... and both fit neatly on a page right next to one another.
Documentation is hard. Good documentation is harder. There are many occasions where video and video-like things are good for getting a feel for something and just plain text is good for reference. We shouldn't be saying "just use text because you probably won't bother doing everything you should". We should be saying "Hey, video, still images, and text all combine to make great documentation and help people to understand and use your tool / product." They take time, but we should care about our users, and thus we should take the time to support them.
That's how I did the animations for this Powershell tool.
1) Doesn't work with powerpoint if you have to use that
2) There's no "pause" point. A lot of time you want to have the command play to a certain point but then cause until you click "next" so that you can explain things to the audience before continuing on.
3) End up having to fiddle a lot with the JSON so the timing feels decent vs me copy/pasting into it and hitting enter.
Either way, looks nice!
Although a bit irrelevant, like the gradient!
This plays back in the terminal, not in something you can put on the web as easily.
$ asciinema rec session.cast
$ asciinema play session.cast> Rendering of recordings in asciicast format made with asciinema
I quite like there being an intermediate file like there is in asciinema that you can edit by hand to remove your typos or speed boring bits up.
Do you think you could also add support for ttyrec input?
This would allow converting existing ttyrecs and have a a full suite of tools creating all the options ready to upload between 1) standard text format record, 2) regular animated gif, 3) svg when saving space is important (while gaining zoom abilities as well!)
Fits right into a document I am developing.
I ended up using OBS to make a screen capture. Now I have an MP4 that plays in a vanilla html5 video tag and will work forever.
Now, what is killer is that the recording is just a text file, so I can edit it and check it in to my source control system, rather than having to mangle some screen recording environment and check in a binary blob that's hard/impossible to edit in the future.
It's also pretty universally guaranteed to work since it doesn't demand much of the browser as far as weird javascript features go, and means I can deliver a whole screen recording in the fraction of the size of an MP4 file. It's screen resolution agnostic, making it more functional for a wider class of users than a video. I also don't have to ship a different version of the recording if I want a high contrast version for accessibility reasons.
So, yeah, plenty of reasons to use asciinema over a conventional screen recording.
For people who want to render asciicast to SVG, I can highly recommend svg-term-cli[1].
ttyrec is a standard format that most people and tools understand.
And if you want something fancy that asciinema output, you can use seq2gif which support all the bells n whistles asciinema does, while allowing you to also upload the ttyrec file.
However, I would suggest not using unicode or Ansi color in your recordings.
You want to demo a feature, not show your cool terminal or the amazing gif you made. The gif is just a byproduct. Keeping to plain text as much as possible makes your recording available to people using text terminals and Braille screen readers.
My most recent example: https://github.com/csdvrx/pg_csdvrx/raw/master/pg_csdvrx.tty... and https://github.com/csdvrx/pg_csdvrx/raw/master/pg_csdvrx.gif
(in case you wonder why I'm doing a cat /dev/random into a live postgres database block file, this is to show how I can recover the database content from the raw directory. Kids, don't try this at home. Don't try it at your parents work on their production database either. In fact, just don't do that, it is only for when your database ends up in /lost+found)
GIFs look poor - they don't capture colours well. They're not accessible. They don't zoom. Copy and paste doesn't work.
>And if you want something fancy that asciinema output, you can use seq2gif which support all the bell n whites asciinema does, while allowing you to also upload the ttyrec file.
Unless I'm missing something obvious (possible!), seq2gif makes a GIF file. How does this "support all the bell n whites asciinema does"?
>However, I would suggest not using unicode or Ansi color in your recordings.
It's 2019, there's no excuse for these (and emoji!) not working fine.
>You want to demo a feature, not show your cool terminal or the amazing gif you made. The gif is just a byproduct. Keeping to plain text as much as possible makes your recording available to people using text terminals and Braille screen readers.
Agreed - how does seq2gif fit in with this? Or are you saying the ttyrecord files are more accessible?
It looks like a binary format, I have nothing on my system that can read it. I do have a web browser, though.
I do. You can edit them like if you made a typo. They are common, so there's an ecosystem of tools if you don't like raw edits.
Next to that, asciinema looks like reeinventing the wheel, except it's no longer round, so it requires special tools and roads now. But what's a few extra dependencies? It looks better and it's new!
> I have nothing on my system that can read it. I do have a web browser, though.
In general, I prefer a standard format supported by many free software tools that lets me create a file in another standard format that I can put on my website without requiring various other dependencies, like javascripts. Especially if I can pacman / apt-get install the tools.
> seq2gif makes a GIF file. How does this "support all
asciinema #1 use case is to show a recording with color, unicode, etc. I think that's a bad idea for accessibility. You want to show features, not look cool. Still seq2gif gives you that, and the output in a standard format. You can replay the original in a normal term, copy paste etc.
If you think copy & paste from the browser showing an animated replay of the terminal is an important use case #2, huh, we have different use cases, but I don't see how it couldn't be done as another target (seq2something_else, maybe seq2svg?) from a well known and accessible format like ttyrec
Which are? This is the first I'm hearing of ttyrecord in the first place.
> Especially if I can pacman / apt-get install the tools.
asciinema is in the arch repos, "ttyrec" is in the AUR. Both are in the debian repos.
> You want to show features, not look cool
The use you're talking about is in marketing material. Looking cool is a feature!
For example, ttyrec is a 33KB standalone binary while asciinema needs python. This might be a problem if you are recording something on a remote machine with limited access or resources.
You can upload ttyrec data to asciinema so nothing really changes on that front.
At least I learned about the SVG alternatives to asciinema that's both getting a better vectorial results, and saving size compared to a gif output. It is so obvious in retrospect! More kudos to the author for thinking about supporting various input formats, including asciinema.