Hello HN,<p>I have an idea for a CLI and want to start writing it soon. I want a robust language/framework that is meant for writing CLIs. I have used Golang/Cobra before and I have done minor things using C++.<p>I also want this to be a learning experience. So I will be starting with the language/framework from absolute scratch.<p>So the secondary question behind this Ask HN is, which CLI framework should you know in 2018?
It depends largely on what you're doing, and where it will be running.<p>If you're writing something that takes a bunch of flags, then parses text, I'd use perl. If you're using somethign that must be easily installed on 100+ hosts then perhaps a binary compiled from go - because that's easy to install.<p>For frameworks? That's probably secondary to the actual core of your application. If you're writing a complex UI with (n)curses then that's more interesting and complex than calling getopt a few times..
I know you’ve used Go, but I personally think it’s unbeatable mostly because it’s statically compiled binaries make them super portable. Compile once and you can distribute a single binary file per platform.
Granted, I've only ever written CLI apps using this and nothing else, but I've written a few smaller CLI apps in C# using <a href="https://github.com/commandlineparser/commandline" rel="nofollow">https://github.com/commandlineparser/commandline</a> and found the library to be a pleasure to work with.
I write all my CLIs in Python.<p>I find that I always need various random things to work together and have always found Python to be the most robust at this. Plus it has pretty much anything you'd need already implemented.
In terms of portability and installed base Python or Perl probably are the best choices. They come installed with most UNIX, BSD or UNIX-like operating systems such as Linux.