go-arg
Struct-based argument parsing in Go (by alexflint)
cobra
A Commander for modern Go CLI interactions (by spf13)
Our great sponsors
go-arg | cobra | |
---|---|---|
2 | 70 | |
1,403 | 27,273 | |
- | - | |
4.4 | 8.7 | |
23 days ago | 6 days ago | |
Go | Go | |
BSD 2-clause "Simplified" License | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
go-arg
Posts with mentions or reviews of go-arg.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-04-06.
-
Best practice for configuring secrets
I use this: https://github.com/alexflint/go-arg and setting defaults for my local environment. So no need to keep a .env file.
-
Recommended framework/library for creating cli apps in go?
I personally swear by the go-arg package, as i prefer its library-not-framework approach.
cobra
Posts with mentions or reviews of cobra.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-06-21.
- Cobra v1.5.0 Is Released
-
Botway - 🤖 Generate, build, handle and deploy your own bot with your favorite language, for Discord, or Telegram, or Slack.
Cobra
- Cobra - A commander for modern go cli interactions
- Cobra CLI no GO
-
14 great tips to make amazing CLI applications
While it is fun to parse argv by hand, I go straight for full-featured command-line parsing frameworks like cobra in go, clap in rust, click in python, php-cli in PHP.
-
is go a good fit when i dont wanna deal with the messiness of cpp, the strictness of rust, the untypesafeness of python, the forced-oop of java?
Also, while the flag package is nice, you may want to check out cobra.
-
My next client wants to redevelop a java Webapp with go
spf13/cobra - CLI setups like starting the API service and accepting CLI flags, etc.
-
-h --help -help help --? -? ????
The same person makes the most commonly used CLI application library (https://github.com/spf13/cobra) which uses pflag by default.
-
(Part 2) Hate YAML? Build your next tool with HCL!
Cobra is my favorite library to build command-line tools.
-
Building and distributing a command line tool in Golang
We'll use cobra, one of the best command-line libraries available in Go, to parse the commands. In cobra everything is a cobra.Command, and you can have commands with subcommands (like git status, status here is a subcommand of git).
What are some alternatives?
When comparing go-arg and cobra you can also consider the following projects:
urfave/cli - A simple, fast, and fun package for building command line apps in Go
cli - CLI - A package for building command line app with go
kingpin - CONTRIBUTIONS ONLY: A Go (golang) command line and flag parser
go-flags - go command line option parser
kong - Kong is a command-line parser for Go
mitchellh/cli - A Go library for implementing command-line interfaces.
pflag - Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
mow.cli - A versatile library for building CLI applications in Go
cli - GitHub’s official command line tool
docopt.go - A command-line arguments parser that will make you smile.
argparse - Argparse for golang. Just because `flag` sucks