A cli interacts with computer program like go, docker, k8s, npm, vice versa.
Example:
$ go get -u URL
$ docker run -t image
$ kubectl get pods
$ npm install --save package
A common structure
App Subcommands --Flags Args
App has many subcommands Subcommands has own flags and arguments
$ go install github.com/dungtc/go-cli-playground
It will install your binary into $PATH
-help
Usage:
go-cli-playground [command]
Available Commands:
add Add a new task
count Count total tasks
list List of tasks
$ go-cli-playground add Make a cookie
$ go-cli-playground list
1. Do some thing
2. Make a cookie
$ go-cli-playground count
Count: 2