https://github.com/mariuskimmina/go-cli-boilerplate
Boilerplate Code for your next go cli project based on kubectl
https://github.com/mariuskimmina/go-cli-boilerplate
boilerplate cli code-structure go
Last synced: about 1 month ago
JSON representation
Boilerplate Code for your next go cli project based on kubectl
- Host: GitHub
- URL: https://github.com/mariuskimmina/go-cli-boilerplate
- Owner: mariuskimmina
- Created: 2022-02-07T16:47:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-08T08:02:11.000Z (over 4 years ago)
- Last Synced: 2025-10-08T20:14:19.756Z (9 months ago)
- Topics: boilerplate, cli, code-structure, go
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go CLI Boilerplate
This project can be used as a baseline to build your next go cli project. The code structure is based on `kubectl` by Kubernetes.
## Usage
The easiest way to use this code is to clone it and remove the git directory
```
git clone github.com/mariuskimmina/go-cli-boilerplate {yourProjectName}
cd {yourProjectName}
rm -r .git
```
You can then replace the occurences of "Demo" inside the codebase with the name of your own project.
## What's in it?
Running the base command with `go run cmd/demo/main.go`
```
demo is boilerplate code for building your next go cli
Usage:
demo [flags]
demo [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
demo this is a demo command
help Help about any command
Flags:
-h, --help help for demo
Use "demo [command] --help" for more information about a command.
```
An exmaple command also called `demo`, that you can run with `go run cmd/demo/main.go demo -h`
```
this is a demo command
Usage:
demo demo [flags]
Examples:
demo doesn't do anything
Flags:
-h, --help help for demo
```