Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 7 hours ago
JSON representation

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

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.