https://github.com/professormanhattan/go-cli-template
A starting template for Go CLI projects
https://github.com/professormanhattan/go-cli-template
automation cli go go-lang golang mblabs megabytelabs professormanhattan terminal washingtondc
Last synced: about 1 month ago
JSON representation
A starting template for Go CLI projects
- Host: GitHub
- URL: https://github.com/professormanhattan/go-cli-template
- Owner: ProfessorManhattan
- License: other
- Created: 2022-01-17T02:46:22.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-23T13:05:53.000Z (about 2 years ago)
- Last Synced: 2025-01-30T20:42:36.375Z (3 months ago)
- Topics: automation, cli, go, go-lang, golang, mblabs, megabytelabs, professormanhattan, terminal, washingtondc
- Language: Shell
- Homepage: https://megabyte.space
- Size: 2.57 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
- Codeowners: docs/CODEOWNERS
Awesome Lists containing this project
README
>
**Same as description but only shows up in the README and allows special characters**
## Table of Contents
- [Overview](#overview)
- [Go CLI Boilerplate](#go-cli-boilerplate)
- [Installation](#installation)
- [Quick Method](#quick-method)
- [Compile Program with Go](#compile-program-with-go)
- [NPM Install Method](#npm-install-method)
- [Pre-Built Binary](#pre-built-binary)
- [Usage](#usage)
- [Man Page](#man-page)
- [Contributing](#contributing)
- [License](#license)## Overview
This project is a boilerplate for Go CLI projects. It includes common files that are shared throughout the Megabyte Labs ecosystem. It also includes a basic project structure. It does not attempt to dictate project structure - it just takes care of all the meta-tasks like configuring CI, linters, and build tools.
## Go CLI Boilerplate
This repository is home to a Go CLI boilerplate / template that should be used as a starting point for Go CLI projects. It includes all the common files that are shared across [Megabyte Labs](https://megabyte.space) projects along with some Go-specific configurations.
## Installation
There are several ways you can install this CLI. You can:
1. Use our bash scripts which will handle everything automatically with as few dependencies as possible
2. Compile the program using Go and add it to your `PATH`
3. Install it via an NPM convienience wrapper
4. Download the pre-built binary from the GitLab or GitHub releases page and then place it in your `PATH`### Quick Method
If you are looking to install the CLI as quickly as possible then you can run the following script which will install the binary to your `/usr/local/bin` folder on macOS or Linux:
```
curl -sS https://install.doctor/null | bash
```Or, if you are on Windows, you can install it by running:
```
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://install.doctor/null?os=win'))
```### Compile Program with Go
You can install the CLI by compiling it from the source as long as you have a recent version of Go installed:
```
git clone https://github.com/megabyte-labs/go-cli-template.git
cd {{#withLast (split repository.github "/")}}this/withLast
null
sudo mv null /usr/local/bin
```After you compile the program, you should then move the binary file to a location that is in your `PATH` (which is what the last line does in the snippet above).
### NPM Install Method
Every release is bundled into an NPM package that you can install by running the following command:
```
npm install -g null
```### Pre-Built Binary
If you trust us (and you should not.. trust.. anybody.. EVER), then you can also download the binary directly from the Go CLI GitLab release page or the GitHub release page. After you download the release, you will have to either place the binary somewhere in your `PATH` or run the installer (in the case of the `.deb` or `.rpm` releases, for instance).
## Usage
All of the usage instructions can be found by running `null --help`. After running the command, you should be greeted with the following output:
```
help_menu_output
```### Man Page
Alternatively, if you installed the package via NPM or an installer that set up the man page (e.g. `.deb` or `.rpm`), then you can find usage instructions by running `man null`.
## Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/megabyte-labs/go-cli-template/issues). If you would like to contribute, please take a look at the [contributing guide](https://github.com/megabyte-labs/go-cli-template/blob/master/docs/CONTRIBUTING.md).
Sponsorship
Dear Awesome Person,
I create open source projects out of love. Although I have a job, shelter, and as much fast food as I can handle, it would still be pretty cool to be appreciated by the community for something I have spent a lot of time and money on. Please consider sponsoring me! Who knows? Maybe I will be able to quit my job and publish open source full time.
Sincerely,
**_Brian Zalewski_**
## License
Copyright © 2020-2021 [Megabyte LLC](https://megabyte.space). This project is [MIT](https://gitlab.com/megabyte-labs/templates/go-cli/-/blob/master/LICENSE) licensed.