Skip to content

erikgeiser/promptkit

Repository files navigation

promptkit

Interactive command line prompts with style!

Release Go Doc GitHub Action: Build
GitHub Action: Check Software License Go Report Card

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:

  • The API of library is not yet stable. Expect significant changes in minor versions before v1.0.0.

Selection

Selection with filter and pagination support: Example Code

Selection Prompt


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

Custom Selection Prompt

The selection module also contains a multi-selection prompt (this is still a preview, use go get go get github.com/erikgeiser/promptkit@main): Example Code

Multi-Selection Prompt

The selection module also contains a multi-selection prompt (this is still a preview, use go get go get github.com/erikgeiser/promptkit@main): Example Code

Custom Multi-Selection Prompt


Text Input

A text input that supports editable default values: Example Code

Text Input Prompt


Custom validation is also supported: Example Code

Custom Text Input Prompt


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

Hidden Text Input Prompt

The text input prompt also supports auto-completion: Example Code

Text Input Prompt With Auto-Completion

For longer inputs, there is also a textara (this is still a preview, use go get go get github.com/erikgeiser/promptkit@main): Example Code

Text Area Prompt

It can also be customized (this is still a preview, use go get go get github.com/erikgeiser/promptkit@main): Example Code

Custom Text Area Prompt


Confirmation Prompt

A confirmation prompt for binary questions: Example Code

Confirmation Prompt

The confirmation prompt can be customized as well: Example Code:

Custom Confirmation Prompt

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: