https://github.com/markelog/list
Terminal interactive list
https://github.com/markelog/list
cli console go golang interactive list terminal view
Last synced: 9 months ago
JSON representation
Terminal interactive list
- Host: GitHub
- URL: https://github.com/markelog/list
- Owner: markelog
- License: mit
- Created: 2016-08-11T03:08:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-09-28T13:55:41.000Z (almost 3 years ago)
- Last Synced: 2025-08-14T23:30:32.947Z (11 months ago)
- Topics: cli, console, go, golang, interactive, list, terminal, view
- Language: Go
- Size: 88.9 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# List [](https://travis-ci.org/markelog/list) [](https://godoc.org/github.com/markelog/list) [](https://goreportcard.com/report/github.com/markelog/list)
> Terminal interactive list
This
```go
options := []string{"Gangsta panda", "Sexy turtle", "Killa gorilla",}
// returns user choice i.e. "Gangsta panda"
list.GetWith("Which animal is the coolest?", options)
```
Will get you

## A bit of flexibility
```go
package main
import (
"fmt"
"github.com/fatih/color"
"github.com/markelog/list"
)
options := []string{"Gangsta panda", "Sexy turtle", "Killa gorilla",}
l := list.New("Which animal is the coolest?", options)
// Set your own printer
l.SetPrint(func(args ...interface{}) (n int, err error) {
return fmt.Print(args...)
})
// Set your own colors
// With github.com/fatih/color package
l.SetColors(&list.Colors{
Head: color.New(color.BgRed),
Option: color.New(color.FgGreen, color.Underline),
Highlight: color.New(color.FgCyan, color.Bold),
})
// Show the list
l.Show()
// Waiting for the user input
l.Get()
```