Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 4 hours 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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-08T08:02:11.000Z (almost 3 years ago)
- Last Synced: 2024-06-21T19:05:59.606Z (5 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 cliUsage:
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 commandFlags:
-h, --help help for demoUse "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 commandUsage:
demo demo [flags]Examples:
demo doesn't do anythingFlags:
-h, --help help for demo
```