Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liamg/flinch
A collection of terminal-based widgets for richer Golang CLI apps.
https://github.com/liamg/flinch
cli gui terminal-ui tui
Last synced: about 2 months ago
JSON representation
A collection of terminal-based widgets for richer Golang CLI apps.
- Host: GitHub
- URL: https://github.com/liamg/flinch
- Owner: liamg
- License: unlicense
- Created: 2021-02-03T18:56:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-24T18:01:38.000Z (over 3 years ago)
- Last Synced: 2024-11-02T02:50:35.038Z (about 2 months ago)
- Topics: cli, gui, terminal-ui, tui
- Language: Go
- Homepage:
- Size: 1.47 MB
- Stars: 44
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
![](example_input.png)
```golang
name, _ := widgets.Input("Enter your name...")
```### Password Input
![](example_password.png)
```golang
password, _ := widgets.PasswordInput("Enter your password...")
```### List Selection
![](example_list.png)
```golang
_, item, err := widgets.ListSelect(
"Select an environment...",
[]string{
"Development",
"Test",
"Staging",
"Production",
},
)
```### Multi List Selection
![](example_multi.png)
```golang
_, items, err := widgets.MultiSelect(
"Select an option...",
options,
)
```(scrollbars appear for long lists)
### Confirmation
![](example_confirm.png)
```golang
userConfirmed, _ := widgets.Confirm("Are you sure?")
```## Try It Out
You can play with the examples by running them directly, e.g.
```bash
go run ./_examples/multiselect-long/
```## Build Your Own Widgets
Check out the [widgets](widgets) package for inspiration.