https://github.com/dnnrly/goclitem
A simple Go CLI project template
https://github.com/dnnrly/goclitem
bats cli cobra go golang template
Last synced: 5 months ago
JSON representation
A simple Go CLI project template
- Host: GitHub
- URL: https://github.com/dnnrly/goclitem
- Owner: dnnrly
- License: apache-2.0
- Created: 2019-10-26T21:37:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-19T23:28:03.000Z (7 months ago)
- Last Synced: 2025-11-20T01:10:41.635Z (7 months ago)
- Topics: bats, cli, cobra, go, golang, template
- Language: Go
- Homepage:
- Size: 90.8 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Go CLI Template
This is a template for Go CLI tools. Major features are:
1. Setup script
2. Release build action
3. PR validation action
4. Code of Conduct
5. Basic security policy
6. Modules enabled
7. Rudimentary accepance tests
## Setup
1. Create a new repo from this template
2. `$ ./setup.sh`
3. Follow the prompts
Use the `-d` option to see what will be modified without changing any files.
**You can delete everything above this line afterwards.**
# Project Title
One Paragraph of project description goes here
[](https://github.com/dnnrly/goclitem/releases/latest)
[](https://github.com/dnnrly/goclitem/actions?query=workflow%3A%22Release+workflow%22)
[](https://goreportcard.com/report/github.com/dnnrly/goclitem)
[](http://godoc.org/github.com/dnnrly/goclitem)


[](https://twitter.com/intent/tweet?url=https://github.com/dnnrly/goclitem)
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
### Prerequisites
What things you need to build the software and how to install them:
#### `tparse`
[tparse](https://github.com/mfridman/tparse) helps to turn verbose default Go testing output something more friendly.
```shell
go install github.com/mfridman/tparse@latest
```
### `golangci-lint`
Instructions for installing the linter can be found [here](https://golangci-lint.run/docs/welcome/install/#local-installation).
### Installing
```bash
$ git clone http://github.com/dnnrly/goclitem.git
$ cd goclitem
$ make install
```
### Running Unit Tests
```bash
$ make test
```
### Running Acceptance tests
```bash
$ make deps
$ make build acceptance-test
```
## Important `make` targets
* `acceptance-test` - run acceptance tests
* `build` - build the application
* `ci-test` - ci target - run tests to generate coverage data
* `coverage-report` - collate the coverage data
* `generate` - generate mocks and other assets
* `help` - print help message
* `lint` - run linting with golangci-lint
* `test` - run unit tests with tparse
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/dnnrly/goclitem/tags).
## Authors
* **Your name here** - *Initial work* - [dnnrly](https://github.com/dnnrly)
See also the list of [contributors](https://github.com/dnnrly/goclitem/contributors) who participated in this project.
## License
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details
## Acknowledgments
* Important people here