{"id":20354745,"url":"https://github.com/superpaintman/nice","last_synced_at":"2025-10-04T12:17:50.323Z","repository":{"id":46645912,"uuid":"396146977","full_name":"SuperPaintman/nice","owner":"SuperPaintman","description":"Highly customizable and idiomatic Go CLI app framework 👌","archived":false,"fork":false,"pushed_at":"2021-10-01T21:50:00.000Z","size":760,"stargazers_count":209,"open_issues_count":0,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-09T08:03:25.647Z","etag":null,"topics":["cli","command-line","commandline","framework","go","golang","golang-library","nice"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperPaintman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-14T22:26:53.000Z","updated_at":"2024-11-24T13:18:15.000Z","dependencies_parsed_at":"2022-09-26T22:30:22.372Z","dependency_job_id":null,"html_url":"https://github.com/SuperPaintman/nice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fnice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fnice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fnice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperPaintman%2Fnice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperPaintman","download_url":"https://codeload.github.com/SuperPaintman/nice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445926,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","commandline","framework","go","golang","golang-library","nice"],"created_at":"2024-11-14T23:09:33.170Z","updated_at":"2025-10-04T12:17:45.281Z","avatar_url":"https://github.com/SuperPaintman.png","language":"Go","readme":"# Nice 👌\n\n**Nice** is a highly customizable and lightweight framework for crafting CLI\napps.\n\nNice respects idiomatic [Go](https://golang.org/) code and focuses to be clear,\nefficient and easy to write and maintain.\n\nYou can use it as a full-featured non-opinionated framework or use any nice\npackages as stand-alone libraries.\n\nI hope you'll enjoy your nice CLI app!\n\n![Banner](./assets/banner.png)\n\n---\n\n## Table of Contents\n\n- [Hello, Nice!](#hello-nice)\n- [Examples](#examples)\n- [Packages](#packages)\n  - [🖥️ nice/cli](#package-nice-cli)\n  - [🖌️ nice/colors](#package-nice-colors)\n\n---\n\n## Hello, Nice!\n\nLet's start with your first Nice CLI app.\n\nFirst, install the framework:\n\n```sh\n$ go get github.com/SuperPaintman/nice/cli\n```\n\nThen put this code into a file (`hello.go` for example):\n\n```go\npackage main\n\nimport \"github.com/SuperPaintman/nice/cli\"\n\nfunc main() {\n\tapp := cli.App{\n\t\tName:  \"hello\",\n\t\tUsage: cli.Usage(\"Print a friendly greeting\"),\n\t\tAction: cli.ActionFunc(func(cmd *cli.Command) cli.ActionRunner {\n\t\t\tname := cli.StringArg(cmd, \"name\",\n\t\t\t\tcli.Usage(\"Who we say hello to\"),\n\t\t\t\tcli.Optional,\n\t\t\t)\n\t\t\t*name = \"Nice\" // Default value.\n\n\t\t\treturn func(cmd *cli.Command) error {\n\t\t\t\tcmd.Printf(\"Hello, %s!\\n\", *name)\n\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}),\n\t\tCommandFlags: []cli.CommandFlag{\n\t\t\tcli.HelpCommandFlag(),\n\t\t\tcli.VersionCommandFlag(\"0.0.0\"),\n\t\t},\n\t}\n\n\tapp.HandleError(app.Run())\n}\n```\n\nNow you can run it!\n\n```sh\n$ go run . world\n```\n\nOr print the help for your app:\n\n```sh\n$ go run . -h\n```\n\n![Help example](./assets/help.png)\n\n---\n\n## Examples\n\nYou can find [more examples in the `./examples` directory](./examples).\n\n---\n\n## Packages\n\n\u003ch3 id=\"package-nice-cli\" href=\"#package-nice-cli\"\u003e\n\n🖥️ `github.com/SuperPaintman/nice/cli`\n\n\u003c/h3\u003e\n\n[Documentation](https://pkg.go.dev/github.com/SuperPaintman/nice/cli) • [Source](./cli)\n\n```go\nimport \"github.com/SuperPaintman/nice/cli\"\n```\n\n\u003ch3 id=\"package-nice-colors\" href=\"#package-nice-colors\"\u003e\n\n🖌️ `github.com/SuperPaintman/nice/colors`\n\n\u003c/h3\u003e\n\n[Documentation](https://pkg.go.dev/github.com/SuperPaintman/nice/colors) • [Source](./colors)\n\n```go\nimport \"github.com/SuperPaintman/nice/colors\"\n```\n\n---\n\n## Tests\n\n```sh\n$ go test -race ./...\n```\n\n```sh\n$ go test ./... -bench=. -benchmem -run='^Benckmark'\n```\n\n---\n\n## Similar projects\n\n- [flag](https://pkg.go.dev/flag) \u003csup\u003eGo\u003c/sup\u003e\n- [github.com/spf13/cobra](https://github.com/spf13/cobra) \u003csup\u003eGo\u003c/sup\u003e\n- [github.com/urfave/cli](https://github.com/urfave/cli) \u003csup\u003eGo\u003c/sup\u003e\n- [github.com/fatih/color](https://github.com/fatih/color) \u003csup\u003eGo\u003c/sup\u003e\n- [github.com/c-bata/go-prompt](https://github.com/c-bata/go-prompt) \u003csup\u003eGo\u003c/sup\u003e\n- [github.com/muesli/termenv](https://github.com/muesli/termenv) \u003csup\u003eGo\u003c/sup\u003e\n- [github.com/alecthomas/kingpin](https://github.com/alecthomas/kingpin) \u003csup\u003eGo\u003c/sup\u003e\n- [npmjs.com/package/ervy](https://www.npmjs.com/package/ervy) \u003csup\u003eJavaScript\u003c/sup\u003e\n- [npmjs.com/package/commander](https://www.npmjs.com/package/commander) \u003csup\u003eJavaScript\u003c/sup\u003e\n- [npmjs.com/package/chalk](https://www.npmjs.com/package/chalk) \u003csup\u003eJavaScript\u003c/sup\u003e\n- [npmjs.com/package/inquirer](https://www.npmjs.com/package/inquirer) \u003csup\u003eJavaScript\u003c/sup\u003e\n- [npmjs.com/package/prompts](https://www.npmjs.com/package/prompts) \u003csup\u003eJavaScript\u003c/sup\u003e\n- [npmjs.com/package/ora](https://www.npmjs.com/package/ora) \u003csup\u003eJavaScript\u003c/sup\u003e\n- [npmjs.com/package/clui](https://www.npmjs.com/package/clui) \u003csup\u003eJavaScript\u003c/sup\u003e\n\n---\n\n#### License\n\n[MIT](./LICENSE)\n\n---\n\nWith 🫀 by [Aleksandr Krivoshchekov (@SuperPaintman)](https://github.com/SuperPaintman)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperpaintman%2Fnice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperpaintman%2Fnice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperpaintman%2Fnice/lists"}