关于
Highly customizable and idiomatic Go CLI app framework 👌
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Nice 👌
Nice is a highly customizable and lightweight framework for crafting CLI apps.
Nice respects idiomatic Go code and focuses to be clear, efficient and easy to write and maintain.
You can use it as a full-featured non-opinionated framework or use any nice packages as stand-alone libraries.
I hope you'll enjoy your nice CLI app!

Table of Contents
Hello, Nice!
Let's start with your first Nice CLI app.
First, install the framework:
$ go get github.com/SuperPaintman/nice/cli
Then put this code into a file (hello.go for example):
package main
import "github.com/SuperPaintman/nice/cli"
func main() {
app := cli.App{
Name: "hello",
Usage: cli.Usage("Print a friendly greeting"),
Action: cli.ActionFunc(func(cmd *cli.Command) cli.ActionRunner {
name := cli.StringArg(cmd, "name",
cli.Usage("Who we say hello to"),
cli.Optional,
)
*name = "Nice" // Default value.
return func(cmd *cli.Command) error {
cmd.Printf("Hello, %s!\n", *name)
return nil
}
}),
CommandFlags: []cli.CommandFlag{
cli.HelpCommandFlag(),
cli.VersionCommandFlag("0.0.0"),
},
}
app.HandleError(app.Run())
}
Now you can run it!
$ go run . world
Or print the help for your app:
$ go run . -h

Examples
You can find more examples in the ./examples directory.
Packages
🖥️ github.com/SuperPaintman/nice/cli
import "github.com/SuperPaintman/nice/cli"
🖌️ github.com/SuperPaintman/nice/colors
import "github.com/SuperPaintman/nice/colors"
Tests
$ go test -race ./...
$ go test ./... -bench=. -benchmem -run='^Benckmark'
Similar projects
- flag Go
- github.com/spf13/cobra Go
- github.com/urfave/cli Go
- github.com/fatih/color Go
- github.com/c-bata/go-prompt Go
- github.com/muesli/termenv Go
- github.com/alecthomas/kingpin Go
- npmjs.com/package/ervy JavaScript
- npmjs.com/package/commander JavaScript
- npmjs.com/package/chalk JavaScript
- npmjs.com/package/inquirer JavaScript
- npmjs.com/package/prompts JavaScript
- npmjs.com/package/ora JavaScript
- npmjs.com/package/clui JavaScript
License
With 🫀 by Aleksandr Krivoshchekov (@SuperPaintman)
探索相关项目
加载中…