Go to file
2022-05-22 08:53:47 -04:00
.github Re-enable workflow conditions 2022-05-18 23:20:47 -04:00
altsrc Drop extra if condition 2022-04-25 22:21:46 -04:00
autocomplete Properly detect Zsh shell 2022-04-19 16:25:16 -04:00
docs Merge remote-tracking branch 'origin/main' into applying-pr1218 2022-05-22 08:53:47 -04:00
internal Unshallow the clone + toc cleanups 2022-05-18 23:17:57 -04:00
testdata A few follow-up conflict resolutions 2022-05-07 14:43:15 -04:00
.flake8 Allow slightly longer lines in Python scripts 2017-02-14 21:17:32 -08:00
.gitignore Touching up more mkdocs details 2022-05-08 20:49:08 -04:00
app_test.go Merge remote-tracking branch 'origin/main' into applying-pr1218 2022-04-30 14:15:48 -04:00
app.go A few follow-up conflict resolutions 2022-05-07 14:43:15 -04:00
args.go add is set method to flag interface - refer #294 2019-09-15 18:46:52 +05:30
category.go amend comments 2019-12-12 21:29:09 +00:00
cli.go Generate flag types (again?) 2022-05-01 23:02:05 -04:00
CODE_OF_CONDUCT.md Merge master @1.22.1 with v2 2019-09-13 05:17:24 +05:30
command_test.go Unshadow context package 2022-04-23 22:07:16 -04:00
command.go A few follow-up conflict resolutions 2022-05-07 14:43:15 -04:00
context_test.go fix: Nil pointer when getting context's flagSet(#1325) (#1327) 2022-01-16 19:22:57 -05:00
context.go Unshadow context package 2022-04-23 22:07:16 -04:00
docs_test.go Backing out build tag for suggestions per recommendation 2022-05-17 08:49:15 -04:00
docs.go Backing out build tag for suggestions per recommendation 2022-05-17 08:49:15 -04:00
errors_test.go Update docs and tests around cli.Exit 2020-03-24 20:32:39 -04:00
errors.go Cleanup context.go 2021-04-05 07:57:41 -04:00
fish_test.go Move some test helpers from docs_test to fish_test 2022-04-25 10:04:40 -07:00
fish.go Exclude hidden sub-command flags from docs 2022-04-18 20:58:38 -05:00
flag_bool.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_duration.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_float64_slice.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_float64.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_generic.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_int64_slice.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_int64.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_int_slice.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_int.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_path.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_string_slice.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_string.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_test.go Merge branch 'main' into feature/1316-simplified_flag_value_access 2022-04-26 08:12:17 -04:00
flag_timestamp.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_uint64.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag_uint.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
flag-spec.yaml Generate flag types (again?) 2022-05-01 23:02:05 -04:00
flag.go Generate flag types (again?) 2022-05-01 23:02:05 -04:00
funcs.go Unshadow context package 2022-04-23 22:07:16 -04:00
go.mod Guard suggestion capability (+ dependency) with build tag 2022-05-07 15:21:00 -04:00
go.sum Guard suggestion capability (+ dependency) with build tag 2022-05-07 15:21:00 -04:00
godoc-current.txt A few follow-up conflict resolutions 2022-05-07 14:43:15 -04:00
help_test.go Writing tests around changes from #1186 2022-04-21 20:07:06 -04:00
help.go Merge remote-tracking branch 'origin/main' into applying-pr1218 2022-05-22 08:53:47 -04:00
helpers_test.go Add Destination field to TimestampFlag 2021-03-07 03:36:56 +00:00
LICENSE Cleaning up some release-related metadata 2022-04-24 08:10:33 -04:00
Makefile Unshallow the clone + toc cleanups 2022-05-18 23:17:57 -04:00
mkdocs-requirements.txt Attempt to work around materialx yaml loader boom 2022-05-18 22:58:46 -04:00
mkdocs.yml Use correctly spelled repo name in mkdocs config 2022-05-18 22:30:07 -04:00
parse.go Add suggestions support 2020-03-03 13:06:34 +01:00
README.md Backing out build tag for suggestions per recommendation 2022-05-17 08:49:15 -04:00
sort_test.go Merge master @1.22.1 with v2 2019-09-13 05:17:24 +05:30
sort.go Merge master @1.22.1 with v2 2019-09-13 05:17:24 +05:30
suggestions_test.go Backing out build tag for suggestions per recommendation 2022-05-17 08:49:15 -04:00
suggestions.go Backing out build tag for suggestions per recommendation 2022-05-17 08:49:15 -04:00
template.go Remove extraneous line from generated markdown (#1311) 2021-11-06 07:37:42 -04:00
zz_generated.flags_test.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00
zz_generated.flags.go Generate RequiredFlag and VisibleFlag implementations 2022-05-08 13:52:32 -04:00

cli

GoDoc codebeat Go Report Card codecov

cli is a simple, fast, and fun package for building command line apps in Go. The goal is to enable developers to write fast and distributable command line applications in an expressive way.

Usage Documentation

Usage documentation exists for each major version. Don't know what version you're on? You're probably using the version from the main branch, which is currently v2.

Guides for migrating to newer versions:

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.

Using v2 releases

$ go get github.com/urfave/cli/v2
...
import (
  "github.com/urfave/cli/v2" // imports as package "cli"
)
...

Using v1 releases

$ go get github.com/urfave/cli
...
import (
  "github.com/urfave/cli"
)
...

Build tags

You can use the following build tags:

urfave_cli_no_docs

When set, this removes ToMarkdown and ToMan methods, so your application won't be able to call those. This reduces the resulting binary size by about 300-400 KB (measured using Go 1.18.1 on Linux/amd64), due to fewer dependencies.

GOPATH

Make sure your PATH includes the $GOPATH/bin directory so your commands can be easily used:

export PATH=$PATH:$GOPATH/bin

Supported platforms

cli is tested against multiple versions of Go on Linux, and against the latest released version of Go on OS X and Windows. This project uses Github Actions for builds. To see our currently supported go versions and platforms, look at the ./.github/workflows/cli.yml.

License

See LICENSE