The Modern CLI Renaissance
The resurgence of command line interface tools since 2015 emphasizes user-friendly experiences, clear error messages, and accessible documentation, addressing past shortcomings and evolving with user needs and technology.
Read original articleIn recent years, there has been a notable resurgence in the development of command line interface (CLI) tools, reversing a period of stagnation from 1995 to 2015. This revival is attributed to the evolution of user needs and technological advancements, prompting developers to rethink and reinvent traditional CLI tools. The article discusses several key lessons learned from decades of software use, emphasizing the importance of a good out-of-the-box experience, helpful error messages, and concise documentation. Modern CLI tools aim to provide intuitive interfaces that minimize the need for extensive configuration, as seen in examples like the fish shell, which offers powerful features without requiring user setup. Additionally, the article highlights the significance of clear error messages that guide users in troubleshooting, contrasting the vague messages often found in traditional tools with the more informative feedback provided by newer alternatives like Nushell. Documentation should also be easily accessible and focused on common use cases, allowing users to perform tasks without needing to consult manuals frequently. Overall, the article advocates for a thoughtful approach to CLI tool development that prioritizes user experience and addresses historical shortcomings.
- The development of CLI tools has accelerated significantly since 2015.
- Modern tools focus on user-friendly experiences with minimal configuration.
- Clear and informative error messages are essential for effective troubleshooting.
- Documentation should prioritize common use cases to enhance usability.
- The evolution of terminals has influenced the redesign of traditional CLI tools.
Related
In Praise of Low Tech DevEx
The article explores Low-Tech DevEx (LTD) in developer tools, favoring text-based options like vim and make for portability, speed, and user-centric design. It promotes Unix principles for improved developer productivity.
Modern Unix Tool List
The article lists modern Unix command-line tools that enhance traditional utilities, highlighting Atuin, Bat, and Concurrently, while noting some tools as unsatisfactory and emphasizing the need for regular updates.
Essential Terminal Commands Every Developer Should Know
The article discusses ten essential terminal commands for Unix-like systems that enhance developer productivity, including `grep`, `ls`, `cat`, `head`, `awk`, `sed`, and `tail`, with practical usage examples.
Create an internal CLI using Just
The article outlines the development of an internal command-line interface for Acme Corporation to boost productivity, emphasizing the use of the "just" tool for cross-platform command management and documentation.
Obsolete Command-Line Tools of Linux
The article highlights obsolete Linux command-line tools and their modern alternatives, emphasizing the need for transition to enhance functionality and security, recommending tools like tmux, ip, and ssh.
In this very thread we're seeing people say "Well sure, but why not add ...".
The reason why the CLI is good is because it _can't_ do most things people want it to do. Which means you have to think when making an application.
Please, if you're one of the people 'modernizing' the terminal stop and think why the terminal is valuable. Don't make it into another of the long line of UIs which have been destroyed by modern developers.
Python has Textualize which is also very popular for building terminal user interfaces [3]
And we've noticed this renaissance as well of new CLI and TUI tools that we list on Terminal Trove [4].
[2] https://github.com/charmbracelet/bubbletea
Side note: in vim you can press K to see the help page for a specific function. The default is the man page but some plugins will fix this though I'm not aware of one that's let me get away from documents and help files completely (I'd love to pick up docs of the codebase I'm working on. Anyone know of something that will?)
But one thing I want to stress, the defaults of these tools should be the same as the originals as much as possible. This makes them more effective and adoption seamless.
To give two examples fd and ripgrep default to respecting your .gitignore file. If you're not expecting this you can easily land yourself in trouble. Sure, it's in the readme but people are installing through their package managers so it doesn't matter. I'm glad the option exists, but don't make it the fucking default! We have aliases for that stuff. It's always better to error in the direction of too much output than too little. Output can be parsed and searched, but you can't when it's not there.
Btw, here's what pacman says
extra/fd 10.2.0-1
Simple, fast and user - friendly alternative to find
extra/ripgrep 14.1.0-1
A search tool that combines the usability of ag with the raw speed of grep
So I'm surprised people are surprised that people think you can just alias find or grep, since they are advertised as such and this is also what's said through word of mouth. (Yes, people should open man pages and visit the GitHub, but let's be real about our expectations) # dra - automatically download release assets from github
# example: dra download -a "dundee/gdu" -I "gdu" --output "$HOME/bin"
devmatteini/dra
# gdu - disk usage analyzer similar to ncdu but faster
dundee/gdu
# glow - terminal markdown reader
charmbracelet/glow
# jless - json viewer
PaulJuliusMartinez/jless
# lazydocker - terminal docker management ui
jesseduffield/lazydocker
# lazygit - terminal git management ui
jesseduffield/lazygit
# rga - ripgrep-all, grep for PDF
phiresky/ripgrep-all
If I pull this off, building out a CLI that’s as high quality as GitHub & Stripe’s should be trivial since it won’t require building out a web API and it can be dropped into existing web frameworks.
It won’t be as fast as a CLI that runs locally, but that’s kinda not the point of terminal apps that primarily interact with web services.
I have a private beta for folks working on commercial SaaS products that want to deploy a CLI, but don’t want to deal with building out an API.
https://www.kylheku.com/cgit/basta/about/
Something called cdlog for directory navigation:
https://www.kylheku.com/cgit/cdlog/about/
Both of the above things are new [2024].
git clone git://bitreich.org/english_knight
On the rest, nvi/vim and vis (vis is nice to cool with Sam-like extructural regexen) are
more than enough. Nvi as the uberfast vi clone with Unicode support, and vim for
Common Lisp with Slimv.On TUI tools, there's mc, ncdu... those are useful. A lot of them aren't. Finch vs an IRC client and Bitlbee, for instance, swirc + bitlbee it's far more usable, with FInch I always had to do voodoo with the panes.
But I think we should be careful before dismissing the existing CLI/TUI landscape. It's a huge achievement that it's possible for code written in over a dozen scripting languages will just run across different architectures and platforms. A #!/bin/sh script running on a Raspberry PI, a WiFi router, a $20k server, a $300 Chromebook, or a $200 Pinephone will run exactly the same. That's because the standards and technologies that script relies on are ubiquitous. They don't cater to the top 1% of computer users, and they don't change every 5 years when average screen resolution increases.
Which is to say, be careful what you wish for. It's pretty easy to modify your CLI or your semantics when you're not installed on millions of routers across the world [0]. With success comes backwards compatibility concerns, and it's not too long before people start writing blog posts about how your tool needs to "shed historical baggage".
CLI tools are typically respectful of your resources, resources like:
- network bandwidth
- screen size
- attention
- CPU/RAM/disk
We should keep this in mind when we're talking about what defaults make sense. Does enabling LSPs by default mean you have to download a bunch of LSPs you won't use? Does it mean you've gotta maintain a database of LSPs you use/installed? Does it mean I can't use it on a Pinebook Pro without taking 10% off my battery life? Is this core computing infrastructure like grep, find and xargs or something a little more niche like ripgrep or fzf? Does making this interface colorful respect a user's color configuration on their machine (colorblind users, users avoiding blue light, users who setup a desktop theme, etc.)? If this tool generates an error, will it dump 1 error line in my logs or 13? If it generates 100,000 errors because I was processing 100,000 things, will it dump 100,000 error lines in my logs or 1.3 million?
I'm not saying there are clear answers here. My point is that while TFA argues there are clear answers, I'm saying there aren't. You have to target a use case. Andrew Gallant (ripgrep author, among other bonkers things) says he deliberately skipped .gitignore files by default because that's the use case he was targeting. That's great, and I can totally understand where he's coming from. I could also understand a different tool not doing it for different reasons. Neither is correct or incorrect (aside: as engineers, I think we could be taken more seriously if we stopped trying to argue our aesthetic preferences are correct or optimal or whatever--it's OK to just prefer things). Pick a use case. Pick an aesthetic. Pick a mental model.
So, yeah write Helix, write new CLI and TUI tools. But don't do it because existing tools are old and busted or fundamentally incorrect (according to you). Do it because you have a different aesthetic preference (you like colors, you like emoji, you like autocomplete, you like WASD as cursor movement). You don't need the backing of righteous engineering gods before you build something you like. Let me have Vim and I'll let you have PyCharm. Let me have Gleam and I'll let you have Go. There's room enough on this disk for both of us.
[0]: https://daniel.haxx.se/blog/2020/04/15/curl-is-not-removing-...
Before the Web, and during its rise, there was a vast array of productivity tools designed to allow users to do more work, faster, and better, through graphical interfaces. It would have been ridiculous to release a program to users with only a command line interface. We left the dark ages of terminals behind, and pushed into new territory, advancing what users could do with computers.
But once the Web began to develop the capabilities of browsers further, Web programming began to teach young programmers that the web was the only place that needed a graphical interface, because the web was a "universal" graphical application interface (lol, if you don't count the browser wars)
This delighted programmers, as they never really liked making graphical interfaces. Logic and functions were more fun to write than user interfaces (which only made the users - not developers - happier).
This was then hammered home when Markdown was widely adopted for its simplicity, inspiring a sort of text-based Stockholm-syndrome. People started to claim bizarre things, like that the command line and Markdown were preferable (or even superior) to GUIs and WYSIWYGs in almost all cases. More languages were adopted that had no inherent graphics capabilities, and the devs moved ever further towards text.
So the web has unintentionally set back computer science and user productivity by decades. Until browsers lose the spotlight, this will probably continue, and non-web GUIs will continue to be that ugly thing you only write if you have to. Users will continue to languish in these half baked solutions, slaves to the solutions that are presented to them. And devs will continue to create text interfaces that only they enjoy.
Rather than rethinking old ideas and creating new ones, we are simply doubling down on the past.
Related
In Praise of Low Tech DevEx
The article explores Low-Tech DevEx (LTD) in developer tools, favoring text-based options like vim and make for portability, speed, and user-centric design. It promotes Unix principles for improved developer productivity.
Modern Unix Tool List
The article lists modern Unix command-line tools that enhance traditional utilities, highlighting Atuin, Bat, and Concurrently, while noting some tools as unsatisfactory and emphasizing the need for regular updates.
Essential Terminal Commands Every Developer Should Know
The article discusses ten essential terminal commands for Unix-like systems that enhance developer productivity, including `grep`, `ls`, `cat`, `head`, `awk`, `sed`, and `tail`, with practical usage examples.
Create an internal CLI using Just
The article outlines the development of an internal command-line interface for Acme Corporation to boost productivity, emphasizing the use of the "just" tool for cross-platform command management and documentation.
Obsolete Command-Line Tools of Linux
The article highlights obsolete Linux command-line tools and their modern alternatives, emphasizing the need for transition to enhance functionality and security, recommending tools like tmux, ip, and ssh.