go-flags
go-flags: A free Go parser for typed options, layered configuration, help, and completion APIs. Ranked #24 of 60 in Command-Line Interface Frameworks by our editors (6.9/10); pricing: Free plan; best for go CLIs with INI and environment support.
At a glance
- Editor score6.9 / 10
- PricingFree plan
- Best forGo CLIs with INI and environment support
- Free planYes
- Paid fromFree
- Shell completionYes
- Facts checked17 Nov 2026
Where it wins
- Short/long options, defaults, repeats, slices, maps, and callbacks
- Struct-tag binding for environment variables and INI configuration files
- Generated help plus APIs for option and command completion
Where it doesn't
- Reflection-based struct tags tie configuration design to Go types
- Documentation is the stated support channel, favoring self-service troubleshooting
- Focused on Go, so it does not target CLIs in other languages
Our verdict on go-flags
go-flags is an open-source Go package for parsing command-line options in structured applications. It suits solo developers and teams from small projects through enterprise codebases that want options declared with Go structs, reflection, and field tags. The package extends Go’s built-in flag functionality with short and long names, optional arguments, defaults, repeated values, maps, callbacks, option groups, nested namespaces, and command support. Generated, formatted help keeps the interface discoverable as those definitions grow.
The pricing model is open source with a free plan, so adoption does not require a paid tier. Its configuration scope is broader than basic flag parsing: environment-variable binding is available through struct tags, while INI files can be parsed and written. That combination supports applications that need command-line values alongside file- and environment-based settings. Completion APIs cover both options and commands, and the published category specifications identify typed APIs, nested subcommands, shell completion, configuration-file support, and environment binding.
Choose go-flags when a Go application needs one struct-oriented definition to cover command-line options, help output, configuration files, environment variables, and completion. Its reflection-based approach rewards teams comfortable shaping configuration through Go types and tags. Documentation is the stated support channel, which favors self-service work. The package’s focus is Go rather than a cross-language CLI layer, so teams building command-line tools in other languages should select a framework aligned with those ecosystems instead.
Your product? Our editors can test go-flags in depth and publish a review, labelled as paid · from $149/mo →
go-flags pricing
go-flags fact sheet
| Free plan | Yes |
|---|---|
| Paid from | Free |
| Shell completion | Yes |
| Nested subcommands | Yes |
| Code generation | Not verified |
| Config file support | Yes |
| Environment variables | Yes |
| Typed API | Yes |
| Support | Docs |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Pricing | Free plan |
| Website | github.com |
| Facts checked | 17 Nov 2026 |
Alternatives to go-flags
- ClapA free Rust crate with typed parsing, nested commands, validation, and completions.9.4
- ClickA free, open-source toolkit for typed, nested Python command-line applications.9.3
- TyperFree, open-source typed CLI framework with nesting, completions, and configuration support.9.2
See all go-flags alternatives →
Used go-flags? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used go-flags for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
go-flags is listed in our Command-Line Interface Frameworks directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/go-flags/"><img src="https://www.itechguides.com/best/badge/go-flags.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Nov 2026
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update