You see a door in front of you. You can tell it’s a door because it has a knob. You can tell it opens and closes because of the knob and door frames. This is how you can distinguish a door from a wall.

There is no such thing as a knob in command-line interfaces. It’s like you’re surrounded by spheres and polygons and you have no idea how they work. Experts say RTFM (read the fxxking manual), but we have never read a manual of a door. There must be a better way.

This xkcd comic depicts the situation beautifully. (Here is an explanation if you don’t get it.)

Libraries of programming languages are in a better position thanks to IDEs. IDEs provide autocomplete (aka. IntelliSense) with bite-sized descriptions. They also allow you to peek at definitions. The command-line interfaces desperately need IDE-like features and more.

IntelliSense in Visual Studio Code

On a terminal, Fish shell provides the best autocompletion as far as I know. But fish-shell script has to be prepared for each command to achieve autocompletion, and they are mostly done by open-source participants. Because such manual work is required, the number of supported commands is limited.

So we created a parser program extracting command specs from manpages and help texts. Then we generated data for autocompletion for bioinformatics tools. Currently, 244 shell completion scripts are available for fish and zsh.

We have further applied the command specs to make the autocomplete and introspection available on Visual Studio Code in shell script mode.

Autocomplete is just one of many factors making command-line programs discoverable and learnable. We are still on the way.