tanema / gluey

Opinionated CLI Graphical Input

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gluey

Go Reference

Graphical Line User Experience Yes

Gluey is an opinionated graphic input library for CLI applications. It aims to have a simple cross platform interface over configuability. It is meant to be a port of CLI::UI for Go.

Example

A simple example of how easy it is to use

ctx := gluey.New()
// required text input
username, err := ctx.Ask("Username")
// Hidden output
passwd, err := ctx.Password("Password")
// confirm with default to true
agree, err := ctx.ConfirmDefault("Do you agree to our terms", true)
// Select Single
id, hardness, err := ctx.Select(
  "How hard is it to use this library?",
  []string{"Easy", "Medium", "Hard", "WTF"},
)
// Select Many
ids, editors, err := ctx.SelectMultiple(
  "Which Text Editors do you use",
  []string{"Vim", "Emacs", "Sublime", "VSCode", "Atom", "other"},
)

About

Opinionated CLI Graphical Input

License:MIT License


Languages

Language:Go 100.0%