urfave-cli/README.md

71 lines
2.1 KiB
Markdown
Raw Normal View History

cli
===
2021-01-28 00:10:42 +00:00
[![GoDoc](https://godoc.org/github.com/urfave/cli?status.svg)](https://pkg.go.dev/github.com/urfave/cli/v2)
[![codebeat](https://codebeat.co/badges/0a8f30aa-f975-404b-b878-5fab3ae1cc5f)](https://codebeat.co/projects/github-com-urfave-cli)
[![Go Report Card](https://goreportcard.com/badge/urfave/cli)](https://goreportcard.com/report/urfave/cli)
[![codecov](https://codecov.io/gh/urfave/cli/branch/main/graph/badge.svg)](https://codecov.io/gh/urfave/cli)
2016-05-10 18:40:56 +00:00
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.
2013-07-15 01:01:26 +00:00
2019-10-12 07:59:50 +00:00
## 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`.
2019-10-12 07:59:50 +00:00
- `v2` - [./docs/v2/manual.md](./docs/v2/manual.md)
2019-11-13 22:03:36 +00:00
- `v1` - [./docs/v1/manual.md](./docs/v1/manual.md)
2019-10-12 07:59:50 +00:00
2020-04-04 10:09:14 +00:00
Guides for migrating to newer versions:
- `v1-to-v2` - [./docs/migrate-v1-to-v2.md](./docs/migrate-v1-to-v2.md)
2019-12-24 09:22:07 +00:00
## Installation
2020-03-09 08:14:51 +00:00
Using this package requires a working Go environment. [See the install instructions for Go](http://golang.org/doc/install.html).
2019-12-24 09:22:07 +00:00
2020-03-09 08:14:51 +00:00
Go Modules are required when using this package. [See the go blog guide on using Go Modules](https://blog.golang.org/using-go-modules).
2019-12-24 09:22:07 +00:00
2019-11-13 22:03:36 +00:00
### Using `v2` releases
2013-07-15 14:44:17 +00:00
2013-07-15 15:06:43 +00:00
```
2022-04-19 20:57:25 +00:00
$ go get github.com/urfave/cli/v2
2013-07-15 15:06:43 +00:00
```
2019-11-13 22:03:36 +00:00
```go
...
import (
"github.com/urfave/cli/v2" // imports as package "cli"
2019-11-13 22:03:36 +00:00
)
...
```
2019-08-14 04:10:38 +00:00
### Using `v1` releases
2016-05-16 14:46:43 +00:00
2019-08-15 19:30:29 +00:00
```
2022-04-19 20:57:25 +00:00
$ go get github.com/urfave/cli
2019-08-15 19:30:29 +00:00
```
2019-08-15 19:30:29 +00:00
```go
...
import (
"github.com/urfave/cli"
)
2019-08-15 19:30:29 +00:00
...
```
2016-05-16 14:46:43 +00:00
2019-11-13 22:03:36 +00:00
### GOPATH
Make sure your `PATH` includes the `$GOPATH/bin` directory so your commands can
be easily used:
```
2019-11-13 22:03:36 +00:00
export PATH=$PATH:$GOPATH/bin
2013-07-20 22:58:51 +00:00
```
2013-07-15 15:19:49 +00:00
2019-11-13 22:03:36 +00:00
### Supported platforms
cli is tested against multiple versions of Go on Linux, and against the latest
2019-12-19 13:22:26 +00:00
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](https://github.com/urfave/cli/blob/main/.github/workflows/cli.yml).