TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

What is the best language/framework to write CLIs in 2018?

4 pointsby wawhalabout 7 years ago
Hello HN,<p>I have an idea for a CLI and want to start writing it soon. I want a robust language&#x2F;framework that is meant for writing CLIs. I have used Golang&#x2F;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&#x2F;framework from absolute scratch.<p>So the secondary question behind this Ask HN is, which CLI framework should you know in 2018?

6 comments

stevekempabout 7 years ago
It depends largely on what you&#x27;re doing, and where it will be running.<p>If you&#x27;re writing something that takes a bunch of flags, then parses text, I&#x27;d use perl. If you&#x27;re using somethign that must be easily installed on 100+ hosts then perhaps a binary compiled from go - because that&#x27;s easy to install.<p>For frameworks? That&#x27;s probably secondary to the actual core of your application. If you&#x27;re writing a complex UI with (n)curses then that&#x27;s more interesting and complex than calling getopt a few times..
donatjabout 7 years ago
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.
neilsimp1about 7 years ago
Granted, I&#x27;ve only ever written CLI apps using this and nothing else, but I&#x27;ve written a few smaller CLI apps in C# using <a href="https:&#x2F;&#x2F;github.com&#x2F;commandlineparser&#x2F;commandline" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;commandlineparser&#x2F;commandline</a> and found the library to be a pleasure to work with.
jordancampbellabout 7 years ago
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&#x27;d need already implemented.
评论 #16975004 未加载
BjoernKWabout 7 years ago
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.
评论 #16985343 未加载
vgy7ujmabout 7 years ago
Perl or Go for sure.
评论 #17019224 未加载