Skip to content

base project template for a golang cli

Notifications You must be signed in to change notification settings

kilianc/base-golang-cli

Repository files navigation

Note

This repository is a template for Golang based CLIs. To use it:

  1. git clone [email protected]:kilianc/base-golang-cli.git <your-cli-name>
  2. edit the BINARY_NAME value in the Makefile to <your-cli-name>
  3. run make rename-cli


cli-name

cli-name

TBD - Description of this project


❯ bin/cli-name

                                          
                                          
                                          
            put ascii art here            
                                          
                                          
                                          
                                           v0.0.1

• starting `cli-name` (description)
• press ctrl+c to stop

Install

With go install

go install https://github.com/kilianc/cli-name/cmd/[email protected]

With docker

docker run --rm -it cli-name:v0.0.1 --version

With curl

# change the os (linux or darwin) and arch (amd64 or arm64) based on your machine
curl -O https://https://github.com/kilianc/cli-name/releases/download/v0.0.1/cli-name-darwin-arm64.tar.gz
tar -xzf cli-name-darwin-arm64.tar.gz
./cli-name --version

Usage

Note

TODO

Local Development

These are the usual suspects

make run
make run-watch
make build
make test
make cover.html

After running make build the binary available in the bin/ folder

bin/cli-name --version

Docker

If you prefer to build and run cli-name in a docker container, just on of these commands

make docker-build
make docker-run