I promised another team at work I would rewrite their shell script as a command line dev tool in Golang.

The old UX of the script was suboptimal. It ran a slow interactive shell script that made you go through an interactive menu tree every time, even when you already knew what you wanted to do. It had to be run inside Docker to handle a python dependency, making the initial startup even more tedious.

It got me thinking: What makes a good command line tool?

To be sure, we already have CLI tool frameworks (like Cobra) that tell us some common best practices in this area:

(I’ll use Cobra for extensibility, even though the Go standard lib already has a basic flag package.)

A few more things I thought of:

A few things I don’t like in command line tools:

I can’t promise anyone that I can accomplish 100% of this, but I think it’s a good start at a wishlist.