Building interactive command line applications
summary
Claims that rendering the whole terminal UI each update then sending a minimal text diff is simpler and fast enough; demos use Node, ANSI codes and ncurses comparisons, show diffy (virtual-string diffing), single-line-log, neat-input, progress-string and chalk. Built a downloader with a live progress bar that reduces bytes sent, eliminates flicker so copy/paste works, handles resizing and raw-mode input; sizing and cross‑platform quirks (Windows ANSI differences) remain noted and the approach proves practical and testable.
AI-written summary · about
chapters (31)
- 0:00Intro
- 0:27building interactive cli tools
- 1:06author of 650+ modules
- 1:23cli apps are neat
- 2:20run them on other computers using ssh
- 2:49node was made for server apps
- 3:10but is actually great for cli
- 6:48we're gonna need a bigger screen
- 6:59would be cool to update the text in-place.
- 7:14ANSI to the rescue
- 7:39ANSI is magic chars you can print to make your terminal ... do stuff
- 12:57simple, easy, works
- 13:07updating the screen is expensive
- 13:47breaks copy-paste
- 15:17make component based frameworks
- 15:51web frontend had the same journey
- 16:01remember jquery ui?
- 16:56react
- 17:12diff with the dom, make minimal updates
- 17:34made things easy to write
- 17:52easy to test
- 18:12fast enough
- 18:31back to cli
- 23:16cheap to text diff
- 23:31less flicker
- 25:48great for ssh
- 26:01copy-paste works
- 33:49have to use "raw mode 2" on stdin
- 34:09then parse the raw input
- 45:10can diff tiny terminals
- 45:50supports terminal resize
related talks
33mMaking The Terminal Great Again
43mThis wonderful world without a GUI, or How to survive in the terminal with JavaScript
45mBUILDING CLI TOOLS WITH NODEJS
28mWriting command-line interfaces (CLIs) with React. Wait, what? Yeah!
33mBless You My Dev
34mBuilding Interactive npm Command Line Modules
30mCLI Tools for All the Things
32mReact Runs Your Terminal: Let’s Build One Live
