A general purpose project template for golang CLI applications

golang-cli-template

A general purpose project template for golang CLI applications

Test golangci-lint Go Report Card Go Reference codecov

This template serves as a starting point for golang commandline applications it is based on golang projects that I consider high quality and various other useful blog posts that helped me understanding golang better.

Features

Project Layout

  • assets/ => docs, images, etc
  • cmd/ => commandline configurartions (flags, subcommands)
  • pkg/ => packages that are okay to import for other projects
  • internal/ => packages that are only for project internal purposes

How to use this template

bash <(curl -s https://raw.githubusercontent.com/FalcoSuessgott/golang-cli-template/main/install.sh)

Demo Application

$> golang-cli-template
golang-cli project template demo application

Usage:
  golang-cli-template [flags]
  golang-cli-template [command]

Available Commands:
  example     example subcommand which adds or multiplies two given integers
  help        Help about any command
  version     Displays d4sva binary version

Flags:
  -h, --help   help for golang-cli-template

Use "golang-cli-template [command] --help" for more information about a command.
$> golang-cli-template example 2 5 -a
7

$> golang-cli-template example 2 5 -m
10

Makefile Targets

$> make
build                          build golang binary
clean                          clean up environment
cover                          display test coverage
docker-build                   dockerize golang application
fmtcheck                       run gofmt and print detected files
fmt                            format go files
help                           list makefile targets
install                        install golang binary
lint-fix                       fix
lint                           lint go files
pre-commit                     run pre-commit hooks
run                            run the app
test                           run go tests

Contribute

If you find issues in that setup or have some nice features / improvements, I would welcome an issue or a PR :)

Owner
Joshua Murphy
Security and *NIX.
Joshua Murphy
Similar Resources

A template that help you to quick implement some CLI using Go

db-data-generator This is template that help you to quick implement some CLI using Go. This repository is contains following. minimal CLI implementati

Nov 22, 2021

A template and a functioning example for a basic JFrog CLI plugin

hello-frog About this plugin This plugin is a template and a functioning example for a basic JFrog CLI plugin. This README shows the expected structur

Nov 26, 2021

A versatile library for building CLI applications in Go

mow.cli Package cli provides a framework to build command line applications in Go with most of the burden of arguments parsing and validation placed o

Dec 28, 2022

An easy to use menu structure for cli applications that prompts users to make choices.

An easy to use menu structure for cli applications that prompts users to make choices.

WMenu Package wmenu creates menus for cli programs. It uses wlog for its interface with the command line. It uses os.Stdin, os.Stdout, and os.Stderr w

Dec 26, 2022

multi progress bar for Go cli applications

Multi Progress Bar mpb is a Go lib for rendering progress bars in terminal applications. Features Multiple Bars: Multiple progress bars are supported

Dec 28, 2022

GoTTY is a simple command line tool that turns your CLI tools into web applications.

GoTTY is a simple command line tool that turns your CLI tools into web applications.

GoTTY - Share your terminal as a web application

Jan 3, 2023

Dinogo is an CLI framework for build terminal and shell applications in Go.

dinogo Dinogo is an CLI framework for build terminal and shell applications in Go. Features Cross Platform Fast and efficient Keyboard API Enable/Disa

Aug 29, 2022

Prompts users to enter values for required flags in Cobra CLI applications

Cobra Flag Prompt Cobra Flag Prompt prompts users to enter values for required flags. It is an extension of Cobra, and requires that you use Cobra to

Nov 13, 2021

Dapper is a CLI toolkit for compiling, deploying, and managing Algorand applications

🕴️ Dapper Decentralized Application Manager for the Algorand Blockchain Dappman is a Golang CLI toolkit for compiling, deploying, and managing Algora

Feb 11, 2022
General purpose reloader for all projects.

leaf General purpose reloader for all projects. Command leaf watches for changes in the working directory and runs the specified set of commands whene

Nov 8, 2022
Template repository for testing CLI features of applications written in Go

Go CLI testing example This repository provides a template on how to create a testable CLI applications in Go language. As an example, this applicatio

Sep 8, 2022
:zap: boilerplate template manager that generates files or directories from template repositories
:zap: boilerplate template manager that generates files or directories from template repositories

Boilr Are you doing the same steps over and over again every time you start a new programming project? Boilr is here to help you create projects from

Jan 6, 2023
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

Nov 22, 2021
Gobby-cli - CLI application to debug gobby applications

go(bby) Interactive debugging tool for gobby applications Usage Coming soon™ Ins

Feb 8, 2022
A Golang CLI template on Gitpod
A Golang CLI template on Gitpod

A Golang CLI template on Gitpod This is a Golang CLI template configured for ephemeral development environments on Gitpod. Next Steps Click the button

Oct 22, 2021
A Golang CLI template on Gitpod
 A Golang CLI template on Gitpod

This is a Golang CLI template configured for ephemeral development environments on Gitpod.

Nov 5, 2021
A Golang CLI template on Gitpod

A Golang CLI template on Gitpod This is a Golang CLI template configured for eph

Jan 2, 2022
Golang CLI app template.

go-cli Golang CLI app template. TODO Allow having nested commands (i.e. $ myapp cmd0 cmd1 [options...]) Allow to run a custom action when no commands

Mar 10, 2022
A template and a functioning example for a basic JFrog CLI plugin

hello-frog About this plugin This plugin is a template and a functioning example for a basic JFrog CLI plugin. This README shows the expected structur

Dec 21, 2021