Skip to content

echenim/csui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSUI

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

ui widget for terminal

Resources

Stars

Watchers

Forks

Packages

No packages published