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

Overview

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.

Issues
  • [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!

    opened by alexeiras 1
  • 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

    opened by alexeiras 0
  • 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)
    opened by georgijd 0
Releases(v0.0.18)
Owner
Liam Galvin
Security Engineer @form3tech
Liam Galvin
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

Liam Galvin 685 Jul 25, 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. Installation Requirements: golang >= 1.13 Manual Clone the repo Run make && make install Pack

Eric Moynihan 514 Aug 1, 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,

Milos Folic 0 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

seastart dev team 0 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

凹语言 2 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

Sergey Grebenshchikov 39 Jun 6, 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

Luke Johnson 0 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)

Muhammad Usman Shamsi 1 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

Mertcan Davulcu 11 Jul 26, 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

Jonathan Reeves 0 Oct 11, 2021
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

FlamesX128 7 Jun 4, 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

null 2 Jan 1, 2022
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

null 33 Jul 12, 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.

ranna 1 Jan 18, 2022
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

Kyosuke Fujimoto 14 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

Nicholas Page 3 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

null 18.8k Aug 8, 2022
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

Rohit Gupta 2k Aug 5, 2022
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/

艹尼玛 不会用 0 Dec 6, 2021