Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erikgeiser/promptkit
Go prompt library
https://github.com/erikgeiser/promptkit
Last synced: 28 days ago
JSON representation
Go prompt library
- Host: GitHub
- URL: https://github.com/erikgeiser/promptkit
- Owner: erikgeiser
- License: mit
- Created: 2020-11-22T13:01:31.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-26T05:07:08.000Z (about 1 year ago)
- Last Synced: 2024-08-01T13:28:49.715Z (3 months ago)
- Language: Go
- Size: 165 KB
- Stars: 240
- Watchers: 2
- Forks: 21
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
promptkit
Interactive command line prompts with style!
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`.
* Windows is currently not explicitly supported because input events are dropped
when running multiple prompts sequentially due to a bug in
[bubbletea](https://github.com/charmbracelet/bubbletea). See
https://github.com/charmbracelet/bubbletea/pull/140 and
https://github.com/charmbracelet/bubbletea/issues/121 for more information.---
## Selection
Selection with filter and pagination support: [Example Code](https://github.com/erikgeiser/promptkit/blob/main/examples/selection/main.go)
---
The selection prompt is highly customizable and also works well with custom
types which for example enables filtering only on custom fields: [Example Code](https://github.com/erikgeiser/promptkit/blob/main/examples/selection_custom/main.go)---
## Text Input
A text input that supports editable default values: [Example Code](https://github.com/erikgeiser/promptkit/blob/main/examples/textinput/main.go)
---
Custom validation is also supported: [Example Code](https://github.com/erikgeiser/promptkit/blob/main/examples/textinput_custom/main.go)
---
The text input can also be used in hidden mode for password prompts: [Example Code](https://github.com/erikgeiser/promptkit/blob/main/examples/textinput_hidden/main.go)
---
## Confirmation Prompt
A confirmation prompt for binary questions: [Example Code](https://github.com/erikgeiser/promptkit/blob/main/examples/confirmation/main.go)
## Widget
The prompts in this library can also be used as [bubbletea](https://github.com/charmbracelet/bubbletea) widgets: [Example Code](https://github.com/erikgeiser/promptkit/blob/main/examples/bubbletea_widget/main.go)
## Acknowledgements
This library is built on top of many great libraries, especially the following:
- https://github.com/charmbracelet/bubbletea
- https://github.com/charmbracelet/bubbles
- https://github.com/muesli/termenv
- https://github.com/muesli/reflow