Command line nirvana

Posted by Orville Bennett on 16 March 2021
Read time: about 2 minutes

I've been using command line interface (CLI) applications for quite some time, but I feel like with the emergence of the Go and Rust programming language communities we are currently in a golden age of command line usage.

Some of the ones I recently discovered are:

  • delta: a CLI program written in rust that acts as a pager and outputs diffs with much better user experience than the git defaults. It can also be used similarly to the diff command, allowing for comparisons between directories and/or files.
  • glow: This is a go program which will show markdown files, but with formatting, not just plain text output.
  • bat: Yet another rust program which, like cat, will display the text of whatever file you pass to it.
  • ripgrep: One more for the rust bucket: I'm something of an ack/grep replacement junkie. My previous ack tool of choice was rak, the rubygem ack. This one's faster!

I typically find these tools due to references made on twitter (thanks muesli) or github dotfile repositories. But delta was found via web search after a particularly long session diff-ing two directories and thinking "Someone has to have a better way to display this."

Knowing the rust community seems to be amenable to creating (or maybe they just encourage) tools like this (see bat/ripgrep), I added 'rust' to the query. A couple search results in, there was delta. After looking at the github page and trying it out, I quickly decided it was the one for me.

I mean, look at this thing. It's beautiful.

Two column diff view

No really, actually look at it. It shows the config options I used to get delta to show the diffs the way I wanted (i.e. what you're seeing isn't the default). And yes, it has themes that you can use. Check out their docs!