CLI parsing

last updated: Oct 20, 2023

https://github.com/spf13/cobra

The most-used one from a brief survey

https://github.com/urfave/cli

seems a little bit lighter-weight, and the second most popular

https://github.com/docopt/docopt.go

An implementation of docopt in the Go programming language.

https://github.com/peterbourgon/ff

ff stands for flags-first, and provides an opinionated way to populate a flag.FlagSet with configuration data from the environment. By default, it parses only from the command line, but you can enable parsing from environment variables (lower priority) and/or a configuration file (lowest priority).

https://github.com/alecthomas/kong

Kong aims to support arbitrarily complex command-line structures with as little developer effort as possible.

To achieve that, command-lines are expressed as Go types, with the structure and tags directing how the command line is mapped onto the struct.

↑ up