kilianc / base-golang-cli

base project template for a golang cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Note

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

  1. git clone git@github.com: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/cli-name@v0.0.1

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

About

base project template for a golang cli


Languages

Language:Go 51.2%Language:Makefile 39.7%Language:Shell 6.6%Language:Dockerfile 2.6%