Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avamsi/climate
"CLI Mate" autogenerates CLIs from structs / functions (nested subcommands, global / local flags, help generation, typo suggestions, shell completion etc.)
https://github.com/avamsi/climate
cli golang library
Last synced: about 14 hours ago
JSON representation
"CLI Mate" autogenerates CLIs from structs / functions (nested subcommands, global / local flags, help generation, typo suggestions, shell completion etc.)
- Host: GitHub
- URL: https://github.com/avamsi/climate
- Owner: avamsi
- License: unlicense
- Created: 2022-07-13T20:23:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-07T21:33:49.000Z (2 months ago)
- Last Synced: 2024-10-20T20:22:03.770Z (2 months ago)
- Topics: cli, golang, library
- Language: Go
- Homepage: https://pkg.go.dev/github.com/avamsi/climate#section-documentation
- Size: 194 KB
- Stars: 147
- Watchers: 3
- Forks: 3
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cli-frameworks - climate
README
# Climate
Climate "CLI Mate" aims to make creating CLIs in Go easy (and fun!), similar to
[python-fire](https://github.com/google/python-fire).
It's also built on top of [Cobra](https://github.com/spf13/cobra) and so comes
with "batteries included" (help, shell completion etc.).## Usage
https://github.com/avamsi/climate/blob/45ac60897dee0ea9950a1298e9d754ba454fb1eb/cmd/examples/greet/main.go#L11-L54
```
$ greet --helpGreet someone.
Usage:
greet [opts]Flags:
-g, --greeting string (default Hello) greeting to use
-n, --name string (default World) name to greet
-t, --times int number of times to greet
-h, --help help for greet
-v, --version version for greet
```### Subcommands
https://github.com/avamsi/climate/blob/45ac60897dee0ea9950a1298e9d754ba454fb1eb/cmd/examples/jj/main.go#L14-L87
```
$ jj --helpJujutsu (an experimental VCS).
Usage:
jj [command]Available Commands:
completion Generate the autocompletion script for the specified shell
git Commands for working with the underlying Git repo
help Help about any command
init Create a new repo in the given directory
squash Move changes from a revision into its parent
util Infrequently used commands such as for generating shell completions
version Display jj's version informationFlags:
-R, --repository path path to the repo to operate on
--ignore-working-copy don't snapshot / update the working copy
-h, --help help for jj
-v, --version version for jjUse "jj [command] --help" for more information about a command.
``````
$ jj git --helpCommands for working with the underlying Git repo.
Usage:
jj git [command]Available Commands:
export Update the underlying Git repo with changes made in the repo
remote Manage Git remotesFlags:
-h, --help help for gitGlobal Flags:
--ignore-working-copy don't snapshot / update the working copy
-R, --repository path path to the repo to operate onUse "jj git [command] --help" for more information about a command.
```