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

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

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.

Owner
Liam Galvin
Security Engineer @form3tech
Liam Galvin
Similar Resources

This is a cli to watch anime using the console/terminal.

 This is a cli to watch anime using the console/terminal.

monas-chinas-cli Este un un cli para ver anime usando la consola/terminal. This is a cli to watch anime using the console/terminal. ⚠️ AVISO ⚠️ Los an

Dec 8, 2022

Cli and terminal ui for firestore

firestore-cli firestore-cli is a combined cli and terminal ui created to lookup firestore documents directly from your terminal. For now you have to b

Jan 1, 2022

Snippet CLI manger for quickly using code snippets without leaving the terminal

Snippet CLI manger for quickly using code snippets without leaving the terminal

SnipKit - Snippet CLI manager This repository is still work in progress! SnipKit aims to paste code snippets from your favorite snippet manager into y

Dec 27, 2022

CLI tool to access the ranna API from your terminal.

Ranna CLI Usage Usage cli: -auth string ranna API auth token -endpoint string ranna API endpoint (default "http://api.ranna.zekro.

Jan 18, 2022

ghcv-cli makes it easy to view the user-created issues, pull requests, and repositories in the terminal.

ghcv-cli makes it easy to view the user-created issues, pull requests, and repositories in the terminal.

ghcv-cli ghcv-cli makes it easy to view the user-created issues, pull requests, and repositories in the terminal. About Show a list of pull requests c

Mar 13, 2022

A very simple note-taking CLI you can use from the terminal that uses a SQLite DB to persist, and query, notes.

Note Logger Summary A very simple note-taking CLI you can use from the terminal that uses a SQLite DB to persist, and query, notes. Building/Installin

Apr 14, 2022

A simple, fast, and fun package for building command line apps in Go

cli cli is a simple, fast, and fun package for building command line apps in Go. The goal is to enable developers to write fast and distributable comm

Dec 31, 2022

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Jan 8, 2023

Viper: a complete configuration solution for Go applications including 12-Factor apps

Viper: a complete configuration solution for Go applications including 12-Factor apps

Viper v2 feedback Viper is heading towards v2 and we would love to hear what you would like to see in it. Share your thoughts here: https://forms.gle/

Dec 6, 2021
Comments
  • [bug] Confirm widget left/right keys handling

    [bug] Confirm widget left/right keys handling

    Hey @liamg! 👋 Hope everything is going great!

    Just noticed that, in the confirm window, pressing left/right keys will just update the buttons' display. But the actual selected component will still be the one picked upon first render.

    Reproducing it is straight forward. Just run https://github.com/liamg/flinch/blob/main/_examples/confirm/main.go press the right key (the "No" button will be apparently selected) and press Enter. Confirmed: true will be printed out.

    Cheers!

  • Fix right/left keys handling in confirm widget

    Fix right/left keys handling in confirm widget

    Quick (and dirty?) fix. Forward Select/Deselect calls to the buttons' parent component when handling right/left key press.

    Fixes https://github.com/liamg/flinch/issues/6

  • Allow changing default style

    Allow changing default style

    • Set to default style to inherit terminal settings but allow overwriting it with core.SetStyle(s core.Style)
    • Automatically calculate the fainted foreground colour instead of using a hardcoded value (when the fg colour is not inherited from the terminal)
A tiny markup language for terminal output. Makes formatting output in CLI apps easier!
A tiny markup language for terminal output. Makes formatting output in CLI apps easier!

tml - Terminal Markup Language A Go module (and standalone binary) to make the output of coloured/formatted text in the terminal easier and more reada

Dec 14, 2022
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.

Stonks is a terminal based stock visualizer and tracker. Installation Requirements: golang >= 1.13 Manual Clone the repo Run make && make install Pack

Dec 16, 2022
This project is used to get familiar with GoLang cli apps, along with cobra generator.

SecretCTL SecretCTL About the project Status Getting started Layout Notes About the project This project is used to get familiar with GoLang cli apps,

Jan 11, 2022
A simple library to build golang command line (cli / cmd)apps

A simple library to build golang command line (cli / cmd)apps

Jan 11, 2022
cli is a simple, fast, and fun package for building command line apps in Go.

cli cli is a simple, fast, and fun package for building command line apps in Go. The goal is to enable developers to write fast and distributable comm

Jul 10, 2022
A collection of CLI argument types for the Go `flag` package.

flagvar A collection of CLI argument types for the flag package. import "github.com/sgreben/flagvar" Or just copy & paste what you need. It's public d

Sep 26, 2022
A personal collection of handy CLI tools

Toolkit A personal collection of handy CLI tools Installation 1.) Download and extract the ZIP package for the the latest release 2.) Copy the appropr

Nov 8, 2021
Small CLI based programs for solving structural engineering design problems based on the book 'Structural Concrete'

Small CLI based programs for solving structural engineering design problems based on the book 'Structural Concrete' written by M. Nadim Hassoun and Akhtem Al-Manaseer (edition-6)

Nov 26, 2021
Dinogo is an CLI framework for build terminal and shell applications in Go.

dinogo Dinogo is an CLI framework for build terminal and shell applications in Go. Features Cross Platform Fast and efficient Keyboard API Enable/Disa

Aug 29, 2022
A CLI application that allows you to run a complete ToDo app from your terminal application

todo-cli This is a CLI application that allows you to run a complete ToDo app from your terminal application. As a user you can: Create a list of todo

Oct 11, 2021