It's really simple CLI application example using Cobra library
Prerequisites:
Go 1.16+ for building the binary
Go 1.16+ for running the test suite
Cobra v1.1+ for initializing commands
To start cobra project from scratch
cobra init --config .cobra.yaml --pkg-name github.com/anitabee/exploring-go/hello-cobra-cli
To add new command
cobra add hello --config .cobra.yaml
Build app
go build -o cli -ldflags="-w -s"
Run cli tool
// Unix like systems
./cli hello
// Windows systems
cli.exe hello