{"id":16777831,"url":"https://github.com/falcosuessgott/golang-cli-template","last_synced_at":"2026-03-15T13:42:17.757Z","repository":{"id":42716893,"uuid":"361521189","full_name":"FalcoSuessgott/golang-cli-template","owner":"FalcoSuessgott","description":"A general purpose golang CLI  template for Github and Gitlab","archived":false,"fork":false,"pushed_at":"2024-09-10T09:02:26.000Z","size":383,"stargazers_count":64,"open_issues_count":10,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T23:20:34.179Z","etag":null,"topics":["github","gitlab","go","golang","template"],"latest_commit_sha":null,"homepage":"https://falcosuessgott.github.io/golang-cli-template/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FalcoSuessgott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-25T19:36:58.000Z","updated_at":"2025-02-01T18:57:56.000Z","dependencies_parsed_at":"2023-02-18T06:00:52.297Z","dependency_job_id":"11901925-9a0c-428e-b80b-8e77c476d270","html_url":"https://github.com/FalcoSuessgott/golang-cli-template","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalcoSuessgott%2Fgolang-cli-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalcoSuessgott%2Fgolang-cli-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalcoSuessgott%2Fgolang-cli-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalcoSuessgott%2Fgolang-cli-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FalcoSuessgott","download_url":"https://codeload.github.com/FalcoSuessgott/golang-cli-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826796,"owners_count":20354221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","gitlab","go","golang","template"],"created_at":"2024-10-13T07:26:00.462Z","updated_at":"2026-03-15T13:42:17.716Z","avatar_url":"https://github.com/FalcoSuessgott.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# golang-cli-template\n\n\u003cdiv align=\"center\"\u003e\nA general purpose project template for golang CLI applications\n\u003cbr\u003e\n\u003cbr\u003e\nThis 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.\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cimg src=\"https://github.com/FalcoSuessgott/golang-cli-template/actions/workflows/test.yml/badge.svg\" alt=\"drawing\"/\u003e\n\u003cimg src=\"https://github.com/FalcoSuessgott/golang-cli-template/actions/workflows/lint.yml/badge.svg\" alt=\"drawing\"/\u003e\n\u003cimg src=\"https://pkg.go.dev/badge/github.com/FalcoSuessgott/golang-cli-template.svg\" alt=\"drawing\"/\u003e\n\u003cimg src=\"https://codecov.io/gh/FalcoSuessgott/golang-cli-template/branch/main/graph/badge.svg\" alt=\"drawing\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/v/release/FalcoSuessgott/golang-cli-template\" alt=\"drawing\"/\u003e\n\u003cimg src=\"https://img.shields.io/docker/pulls/falcosuessgott/golang-cli-template\" alt=\"drawing\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/downloads/FalcoSuessgott/golang-cli-template/total.svg\" alt=\"drawing\"/\u003e\n\u003c/div\u003e\n\n# Table of Contents\n\u003c!--ts--\u003e\n   * [golang-cli-template](#golang-cli-template)\n   * [Features](#features)\n   * [Project Layout](#project-layout)\n   * [How to use this template](#how-to-use-this-template)\n   * [Demo Application](#demo-application)\n   * [Makefile Targets](#makefile-targets)\n   * [Contribute](#contribute)\n\n\u003c!-- Added by: morelly_t1, at: Tue 10 Aug 2021 08:54:24 AM CEST --\u003e\n\n\u003c!--te--\u003e\n\n# Features\n- [goreleaser](https://goreleaser.com/) with `deb.` and `.rpm` packer and container (`docker.hub` and `ghcr.io`) releasing including `manpages` and `shell completions` and grouped Changelog generation.\n- [golangci-lint](https://golangci-lint.run/) for linting and formatting\n- [Github Actions](.github/worflows) Stages (Lint, Test (`windows`, `linux`, `mac-os`), Build, Release) \n- [Gitlab CI](.gitlab-ci.yml) Configuration (Lint, Test, Build, Release)\n- [cobra](https://cobra.dev/) example setup including tests\n- [Makefile](Makefile) - with various useful targets and documentation (see Makefile Targets)\n- [Github Pages](_config.yml) using [jekyll-theme-minimal](https://github.com/pages-themes/minimal) (checkout [https://falcosuessgott.github.io/golang-cli-template/](https://falcosuessgott.github.io/golang-cli-template/))\n- Useful `README.md` badges\n- [pre-commit-hooks](https://pre-commit.com/) for formatting and validating code before committing\n\n# Project Layout\n* [assets/](https://pkg.go.dev/github.com/FalcoSuessgott/golang-cli-template/assets) =\u003e docs, images, etc\n* [cmd/](https://pkg.go.dev/github.com/FalcoSuessgott/golang-cli-template/cmd)  =\u003e commandline configurartions (flags, subcommands)\n* [pkg/](https://pkg.go.dev/github.com/FalcoSuessgott/golang-cli-template/pkg)  =\u003e packages that are okay to import for other projects\n* [internal/](https://pkg.go.dev/github.com/FalcoSuessgott/golang-cli-template/pkg)  =\u003e packages that are only for project internal purposes\n- [`tools/`](tools/) =\u003e for automatically shipping all required dependencies when running `go get` (or `make bootstrap`) such as `golang-ci-lint` (see: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module)\n)\n- [`scripts/`](scripts/) =\u003e build scripts \n\n# How to use this template\n```sh\nbash \u003c(curl -s https://raw.githubusercontent.com/FalcoSuessgott/golang-cli-template/master/install.sh)\n```\n\nIn order to make the CI work you will need to have the following Secrets in your repository defined:\n\nRepository  -\u003e Settings -\u003e Secrets \u0026 variables -\u003e `CODECOV_TOKEN`, `DOCKERHUB_TOKEN` \u0026 `DOCKERHUB_USERNAME`\n\n# Demo Application\n\n```sh\n$\u003e golang-cli-template -h\ngolang-cli project template demo application\n\nUsage:\n  golang-cli-template [flags]\n  golang-cli-template [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  example     example subcommand which adds or multiplies two given integers\n  help        Help about any command\n  version     golang-cli-template version\n\nFlags:\n  -h, --help   help for golang-cli-template\n\nUse \"golang-cli-template [command] --help\" for more information about a command.\n```\n\n```sh\n$\u003e golang-cli-template example 2 5 --add\n7\n\n$\u003e golang-cli-template example 2 5 --multiply\n10\n```\n\n# Makefile Targets\n```sh\n$\u003e make\nbootstrap                      install build deps\nbuild                          build golang binary\nclean                          clean up environment\ncover                          display test coverage\ndocker-build                   dockerize golang application\nfmt                            format go files\nhelp                           list makefile targets\ninstall                        install golang binary\nlint                           lint go files\npre-commit                     run pre-commit hooks\nrun                            run the app\ntest                           display test coverage\n```\n\n# Contribute\nIf you find issues in that setup or have some nice features / improvements, I would welcome an issue or a PR :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalcosuessgott%2Fgolang-cli-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalcosuessgott%2Fgolang-cli-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalcosuessgott%2Fgolang-cli-template/lists"}