Hacker News new | past | comments | ask | show | jobs | submit login
Make your CLI demos a breeze with zero stress and zero mistakes (martinheinz.dev)
109 points by heinzm on April 5, 2023 | hide | past | favorite | 23 comments



Why not use the built in `script` program? https://man7.org/linux/man-pages/man1/script.1.html


How is it possible, that I've worked as a Linux sysadmin, backend engineer, security developer, and technical writer (regularly sharing CLI snippets in articles), and regularly document my CLI work on my blog, and I'm just learning about this.

Thank you for this comment lol


It's called "script" and it's default output file is called "typescript". Makes it pretty hard to Google for :)


Because the CLI is not discoverable. :)


script seems to require you to type the demo commands perfectly and at the right pace for the demo. That openssl command, for example. Contrast with this tool, where you can get the command right at your leisure then apply magic to look like it's being typed in interactively. The two steps (running commands, interactive typing with desired timing) are much easier to get right separately than together.


It can export timing data that you can tweak. Pretty manual, though it does work.


I've tried halfheartedly to learn to use `script` a few times, and each time I give up. Anybody know of a good tutorial on "why" and "how"?


Asciicinema [1] is stil the most robust terminal capture I have seen.

[1] https://asciinema.org/


I recently used VHS for this https://github.com/charmbracelet/vhs - nice set of tools there to do various cli stuff


Same, I’ve been working on a command line tool and set up VCR to record demos (https://github.com/zachallaun/mneme/blob/main/examples/demo....). I’d be very interested if anyone could speak to the fundamental differences between VCR and the tools referenced in the OP.


I'm sure the linked tools are awesome, but if I were trying to in some way stage a "live" demo, I'd first check Expect.


For live demos "its a live" [0] by @stavros is also great.

From the Readme:

It's a Live lets you write commands and keystrokes in a file, which it will then read and open a new terminal for you. Every time you press a key, It's a Live will write one character from the file into the terminal, making it look like you're typing every single command with the practiced ease of a consummate professional.

[0] https://gitlab.com/stavros/itsalive


https://asciinema.org/ can do this pretty well too.


If I'm not mistaken, asciinema covers only the second part of the article, i.e., recording. It can't do or control the actual demo.


Full demo can be recorded and edited to add/ remove parts. Also, there is a js player that can be used to provide video player like user interface.


An ASCII enema sounds very uncomfortable.


Never gets old.


This looks nice, but if there is a script anyway isn't making an animated GIF of it a relatively poor use of capabilities? Why not have a result that is able to go backward and forward (like a slideshow), the ability to pause/resume, or to copy/paste text from it.


He actually mentions the tool [0] that has all of this, in the end. It records your screen and compiles a demo that runs in any browser by the looks of it.

[0] https://www.terminalizer.com


looks very similar to https://asciinema.org/


Would be nice to have some realistic variations in typing speeds as well as realistic key sound affects too :)


Thanks for sharing! Good post, useful libs explained well.


I just record it with the OS screen recording tool.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: