Welcome to urfave/cli¶
urfave/cli is adeclarative, simple, fast, and fun package for building command line tools in Go featuring:
- commands and subcommands with alias and prefix match support
- flexible and permissive help system
- dynamic shell completion for
bash
,zsh
,fish
, andpowershell
man
and markdown format documentation generation- input flags for simple types, slices of simple types, time, duration, and others
- compound short flag support (
-a
-b
-c
-abc
) - input lookup from:
- environment variables
- plain text files
- structured file formats supported via the
urfave/cli-altsrc
package
These are the guides for each major version:
In addition to the version-specific guides, these other documents are available:
Installation¶
Using this package requires a working Go environment.See the install instructions for Go.
Go Modules are required when using this package.See the go blog guide on using Go Modules.
Usingv2
releases¶
Thev2
series is the recommended version for new development. Ongoingmaintenance is done on thev2-maint
branch which receivesminorimprovements, bug fixes, and security fixes.
gogetgithub.com/urfave/cli/v2@latest
import("github.com/urfave/cli/v2"// imports as package "cli")
Usingalpha-levelv3
releases¶
The latest pre-release in progress on themain
branch is thev3
series which shouldbe consideredalpha-level with an unstable API. Occasionalalpha tagsare pushed to allow for limited stability without pinning to an arbitrarycommit. Please see thev3
migrationguide on using v3 if you are upgrading from v2
gogetgithub.com/urfave/cli/v3@latest
import("github.com/urfave/cli/v3"// imports as package "cli")
Usingv1
releases¶
The
v1
series is receivingsecurity fixes only via thev1-maint
branch andshouldnot be used in new development. Please see thev2
migrationguide and feel free to open an issue or discussion ifyou need help with the migration tov2
.
Supported platforms¶
cli is tested against multiple versions of Go on Linux, and against the latestreleased version of Go on OS X and Windows. This project uses GitHub Actionsfor builds. To see our currently supported go versions and platforms, look atthegithub workflowconfiguration.
June 29, 2024