liamg / flinch

A collection of terminal-based widgets for richer Golang CLI apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flinch

A collection of terminal-based widgets for richer Golang CLI apps.

Ships with a library to build your own widgets/TUIs too.

Warning: This module is experimental right now.

Input

name, _ := widgets.Input("Enter your name...")

Password Input

password, _ := widgets.PasswordInput("Enter your password...")

List Selection

_, item, err := widgets.ListSelect(
    "Select an environment...",
    []string{
        "Development",
        "Test",
        "Staging",
        "Production",
    },
)

Multi List Selection

_, items, err := widgets.MultiSelect(
    "Select an option...",
    options,
)

(scrollbars appear for long lists)

Confirmation

userConfirmed, _ := widgets.Confirm("Are you sure?")

Try It Out

You can play with the examples by running them directly, e.g.

go run ./_examples/multiselect-long/

Build Your Own Widgets

Check out the widgets package for inspiration.

About

A collection of terminal-based widgets for richer Golang CLI apps.

License:The Unlicense


Languages

Language:Go 99.9%Language:Makefile 0.1%