Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olegsu/cli-generator
Generate CLI entrypoints from spec file
https://github.com/olegsu/cli-generator
cli cli-generator go golang
Last synced: 1 day ago
JSON representation
Generate CLI entrypoints from spec file
- Host: GitHub
- URL: https://github.com/olegsu/cli-generator
- Owner: olegsu
- License: other
- Created: 2019-09-24T19:14:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T03:23:29.000Z (over 1 year ago)
- Last Synced: 2024-11-01T08:34:09.401Z (12 days ago)
- Topics: cli, cli-generator, go, golang
- Language: Go
- Homepage:
- Size: 130 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Go Report Card](https://goreportcard.com/badge/github.com/olegsu/cli-generator)](https://goreportcard.com/report/github.com/olegsu/cli-generator)
# CLI-GENERATOR
Generate CLI entrypoints from spec file
Any feedback on the spec is welcome## Install
`go get -u github.com/olegsu/cli-generator`## Run Example
* `git clone [email protected]:olegsu/cli-generator.git`
* `cd cli-generator`
* `make example`The main idea is to define a spec that can describe a CLI in YAML or JSON format.
Spec must include:
1. Name of the application(project)
* Example: `docker`, `kubectl`
2. Global flags the CLI would support
* Example: `kubectl --context`
3. Commands, including nasted sub-commands and aliases
* Example: `kubectl get`, `docker system prune`, `kubectl get po`, `kubectl get pods`
4. Flags per command, including types [array of strings] [enum] definition, default values and environment variables are eqvivalent
* Example: `kubectl logs -f [NAME]`
5. Positional argumens, including multiple arguments
* Example: `kubectl delete po [PO_1] [PO_2]`
6. Auto generate help or provide a way to override help per command