Suggestions appear as you type. Use the up and down arrows to choose one and Enter to open it.

go-flags

Free#24 of 60 in Command-Line Interface Frameworks

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.

6.9/10Editor score
go-flags6.9 Visit go-flags

At a glance

  • Editor score
    6.9 / 10
  • Pricing
    Free plan
  • Best for
    Go CLIs with INI and environment support
  • Free plan
    Yes
  • Paid from
    Free
  • Shell completion
    Yes
  • Facts checked
    17 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

Plans Free planFree Free to use — no paid tier required for the core job.
See plans on github.com

go-flags fact sheet

Free planYes
Paid fromFree
Shell completionYes
Nested subcommandsYes
Code generationNot verified
Config file supportYes
Environment variablesYes
Typed APIYes
SupportDocs
Built forSolo, Small business, Mid-market, Enterprise (editorial estimate)
PricingFree plan
Websitegithub.com
Facts checked17 Nov 2026

Alternatives to go-flags

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

Reviews come only from verified accounts. Sign in or create an account first — your e-mail is never shown.

Your rating

0 characters · at least 80, up to 3,000

Posted from your verified account. Reviews appear after an editor reads them, usually within two working days.

Featured on iTechGuides

Featured on iTechGuides — go-flags 6.9/10

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