All Projects → SuperPaintman → nice

SuperPaintman / nice

Licence: MIT License
Highly customizable and idiomatic Go CLI app framework 👌

Programming Languages

go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nice

scrift
New generation shell and scripting language for everyone.
Stars: ✭ 46 (-76.77%)
Mutual labels:  commandline
note-keeper
📓 A tiny bash tool for taking and organizing notes.
Stars: ✭ 58 (-70.71%)
Mutual labels:  commandline
CommandLineParser.Core
💻 A simple, light-weight and strongly typed Command Line Parser made in .NET Standard!
Stars: ✭ 32 (-83.84%)
Mutual labels:  commandline
momoapi-python
MTN MoMo API Client Library for Python
Stars: ✭ 37 (-81.31%)
Mutual labels:  commandline
Commandline-Games-hacktoberfest
A repository to share command line games. An opportunity to start and learn about open source code contributions flow.
Stars: ✭ 16 (-91.92%)
Mutual labels:  commandline
vt100
💻 VT100 Terminal Package
Stars: ✭ 19 (-90.4%)
Mutual labels:  commandline
tcolors
Commandline color picker and palette builder
Stars: ✭ 44 (-77.78%)
Mutual labels:  commandline
debayer
Debayer raw images automatically, with the option of outputting scene-linear aces exrs.
Stars: ✭ 26 (-86.87%)
Mutual labels:  commandline
import-cli-simple
This the meta package for Pacemaker Community, a Symfony based CLI application that provides import functionality for products, categories, attributes, and attribute-sets. The default format is CSV, adapters for XML are also available. The application can be declaratively extended by additional operations, which can be used to reassemble and exe…
Stars: ✭ 69 (-65.15%)
Mutual labels:  commandline
simplecli
The simplest way to parse cli arguments in golang
Stars: ✭ 15 (-92.42%)
Mutual labels:  commandline
ansiart2utf8
Processes legacy BBS-style ANSI art (ACiDDraw, PabloDraw, etc.) to UTF-8. Escape codes and line endings are processed for terminal friendliness.
Stars: ✭ 32 (-83.84%)
Mutual labels:  commandline
DfmExtractor
Small command line utility which allows you to extract DFM, LFM and FRM forms from executable files compiled by Delphi, Lazarus and CodeTyphon.
Stars: ✭ 22 (-88.89%)
Mutual labels:  commandline
prettyBenching
🦕 A small lib to make your Deno benchmarking progress and results look pretty
Stars: ✭ 23 (-88.38%)
Mutual labels:  commandline
ufolint
UFO source format linter
Stars: ✭ 23 (-88.38%)
Mutual labels:  commandline
tiles
Commandline tool that makes building tilesets and rendering static tilemaps super easy!
Stars: ✭ 51 (-74.24%)
Mutual labels:  commandline
include gardener
This is a small C++ based commandline-tool which analyzes include statements in C/C++ code.
Stars: ✭ 66 (-66.67%)
Mutual labels:  commandline
select-run
A CLI tool to interactively search & select one or many package.json npm scripts to run
Stars: ✭ 29 (-85.35%)
Mutual labels:  commandline
git-admin
A package to help manage git repositories through the commandline
Stars: ✭ 27 (-86.36%)
Mutual labels:  commandline
Data-Scientist-In-Python
This repository contains notes and projects of Data scientist track from dataquest course work.
Stars: ✭ 23 (-88.38%)
Mutual labels:  commandline
cotp
Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality.
Stars: ✭ 45 (-77.27%)
Mutual labels:  commandline

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!

Banner


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

Help example


Examples

You can find more examples in the ./examples directory.


Packages

🖥️ github.com/SuperPaintman/nice/cli

DocumentationSource

import "github.com/SuperPaintman/nice/cli"

🖌️ github.com/SuperPaintman/nice/colors

DocumentationSource

import "github.com/SuperPaintman/nice/colors"

Tests

$ go test -race ./...
$ go test ./... -bench=. -benchmem -run='^Benckmark'

Similar projects


License

MIT


With 🫀 by Aleksandr Krivoshchekov (@SuperPaintman)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].