Home

Awesome

<p align="center"> <h1 align="center"><b>promptkit</b></h1> <p align="center"><i>Interactive command line prompts with style!</i></p> <p align="center"> <a href="https://github.com/erikgeiser/promptkit/releases/latest"><img alt="Release" src="https://img.shields.io/github/release/erikgeiser/promptkit.svg?style=for-the-badge"></a> <a href="https://pkg.go.dev/github.com/erikgeiser/promptkit"><img alt="Go Doc" src="https://img.shields.io/badge/godoc-reference-blue.svg?style=for-the-badge"></a> <a href="https://github.com/erikgeiser/promptkit/actions?workflow=Build"><img alt="GitHub Action: Build" src="https://img.shields.io/github/actions/workflow/status/erikgeiser/promptkit/build.yml?branch=main&style=for-the-badge"></a> </br> <a href="https://github.com/erikgeiser/promptkit/actions?workflow=Check"><img alt="GitHub Action: Check" src="https://img.shields.io/github/actions/workflow/status/erikgeiser/promptkit/check.yml?branch=main&style=for-the-badge"></a> <a href="/LICENSE.md"><img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge"></a> <a href="https://goreportcard.com/report/github.com/erikgeiser/promptkit"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/erikgeiser/promptkit?style=for-the-badge"></a> </p> </p>

Promptkit is a collection of common command line prompts for interactive programs. Each prompts comes with sensible defaults, re-mappable key bindings and many opportunities for heavy customization.


Disclaimers:


Selection

Selection with filter and pagination support: Example Code

<a href="https://asciinema.org/a/8co2qSgAIxRZBJzvX5iZXwUqF" target="_blank"><img src="https://asciinema.org/a/8co2qSgAIxRZBJzvX5iZXwUqF.svg" /></a>


The selection prompt is highly customizable and also works well with custom types which for example enables filtering only on custom fields: Example Code

<a href="https://asciinema.org/a/Uw7QjXK7nZ0eHmigqIzdDXk3C" target="_blank"><img src="https://asciinema.org/a/Uw7QjXK7nZ0eHmigqIzdDXk3C.svg" /></a>


Text Input

A text input that supports editable default values: Example Code

<a href="https://asciinema.org/a/xUudX97RAXNnHMkArASH4Ccgv" target="_blank"><img src="https://asciinema.org/a/xUudX97RAXNnHMkArASH4Ccgv.svg" /></a>


Custom validation is also supported: Example Code

<a href="https://asciinema.org/a/FF14DYA8WtEtRjdPkcllAJk9p" target="_blank"><img src="https://asciinema.org/a/FF14DYA8WtEtRjdPkcllAJk9p.svg" /></a>


The text input can also be used in hidden mode for password prompts: Example Code

<a href="https://asciinema.org/a/k2KTLG49OWWQ3AofrGSzWVmkL" target="_blank"><img src="https://asciinema.org/a/k2KTLG49OWWQ3AofrGSzWVmkL.svg" /></a>


Confirmation Prompt

A confirmation prompt for binary questions: Example Code

<a href="https://asciinema.org/a/dpQHPP22ceylJGbSthAekZwBB" target="_blank"><img src="https://asciinema.org/a/dpQHPP22ceylJGbSthAekZwBB.svg" /></a>

Widget

The prompts in this library can also be used as bubbletea widgets: Example Code

Acknowledgements

This library is built on top of many great libraries, especially the following: