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.
name, _ := widgets.Input("Enter your name...")
password, _ := widgets.PasswordInput("Enter your password...")
_, item, err := widgets.ListSelect(
"Select an environment...",
[]string{
"Development",
"Test",
"Staging",
"Production",
},
)
_, items, err := widgets.MultiSelect(
"Select an option...",
options,
)
(scrollbars appear for long lists)
userConfirmed, _ := widgets.Confirm("Are you sure?")
You can play with the examples by running them directly, e.g.
go run ./_examples/multiselect-long/
Check out the widgets package for inspiration.