Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tucnak/climax
Climax is an alternative CLI with the human face
https://github.com/tucnak/climax
Last synced: 8 days ago
JSON representation
Climax is an alternative CLI with the human face
- Host: GitHub
- URL: https://github.com/tucnak/climax
- Owner: tucnak
- License: mit
- Created: 2015-11-03T21:04:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-05T07:02:16.000Z (about 4 years ago)
- Last Synced: 2024-10-16T10:28:53.899Z (23 days ago)
- Language: Go
- Homepage: http://git.io/climax
- Size: 25.4 KB
- Stars: 216
- Watchers: 14
- Forks: 16
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - climax - Alternative CLI with "human face", in spirit of Go command. (Command Line / Standard CLI)
- fucking-awesome-go - climax - Alternative CLI with "human face", in spirit of Go command. (Command Line / Standard CLI)
- awesome-go - climax - Alternative CLI with "human face", in spirit of Go command. (Command Line / Standard CLI)
- awesome-go - climax - Alternative CLI with "human face", in spirit of Go command. (Command Line / Standard CLI)
- awesome-go-extra - climax - 11-03T21:04:57Z|2020-09-05T07:02:16Z| (Build Automation / Standard CLI)
- awesome-go-with-stars - climax - Alternative CLI with "human face", in spirit of Go command. (Command Line / Standard CLI)
- awesome-go-plus - climax - Alternative CLI with "human face", in spirit of Go command. (Command Line / Standard CLI)
- awesome-go-plus - climax - Alternative CLI with "human face", in spirit of Go command. ![stars](https://img.shields.io/badge/stars-217-blue) ![forks](https://img.shields.io/badge/forks-16-blue) (Command Line / Standard CLI)
README
# Climax
>Climax is an alternative CLI that looks like Go command[![GoDoc](https://godoc.org/github.com/tucnak/climax?status.svg)](https://godoc.org/github.com/tucnak/climax)
[![Travis](https://travis-ci.org/tucnak/climax.svg?branch=master)](https://travis-ci.org/tucnak/climax)**Climax** is a handy alternative CLI (command-line interface) for Go apps.
It looks pretty much exactly like the output of the default `go` command and
incorporates some fancy features from it. For instance, Climax does support
so-called topics (some sort of Wiki entries for CLI). You can define some
annotated use cases of some command that would get displayed in the
help section of corresponding command also.##### Why creating another CLI?
I didn't like existing solutions (e.g. codegangsta/cli | spf13/cobra) either for
bloated codebase (I dislike the huge complex libraries) or poor output
style / API. This project is just an another view on the subject, it has
slightly different API than, let's say, Cobra; I find it much more convenient.
A sample application output, Climax produces:
```
Camus is a modern content writing suite.Usage:
camus command [arguments]
The commands are:
init starts a new project
new creates flavored book partsUse "camus help [command]" for more information about a command.
Additional help topics:
writing markdown language cheatsheet
metadata intro to yaml-based metadata
realtime effective real-time writingUse "camus help [topic]" for more information about a topic.
```Here is an example of a trivial CLI application that does nothing,
but provides a single string split-like functionality:
```go
demo := climax.New("demo")
demo.Brief = "Demo is a funky demonstation of Climax capabilities."
demo.Version = "stable"joinCmd := climax.Command{
Name: "join",
Brief: "merges the strings given",
Usage: `[-s=] "a few" distinct strings`,
Help: `Lorem ipsum dolor sit amet amet sit todor...`,Flags: []climax.Flag{
{
Name: "separator",
Short: "s",
Usage: `--separator="."`,
Help: `Put some separating string between all the strings given.`,
Variable: true,
},
},Examples: []climax.Example{
{
Usecase: `-s . "google" "com"`,
Description: `Results in "google.com"`,
},
},Handle: func(ctx climax.Context) int {
var separator string
if sep, ok := ctx.Get("separator"); ok {
separator = sep
}fmt.Println(strings.Join(ctx.Args, separator))
return 0
},
}demo.AddCommand(joinCmd)
demo.Run()
```Have fun!