prompti
Lightweight and customizable interactive prompt components for Go based CLI.
Â
Â
Â
prompti is a collection of TUI blocks initially created to be used by sveltin and its use cases. We worked on it to allow customizations and make it available as standalone package. Here it is!
Install
Install the latest version by using the go get
command. Ensure to have (Go v1.18 or higher) installed on your machine.
go get github.com/sveltinio/prompti@latest
Prompts
input
is a terminal input prompt component supporting default values, validations (type ValidateFunc func(string) error
), password input echo and customizable styles.
It also provides ready to use validation functions for some common use cases:
- alphanumeric
- digits only
- integers
- floats
- email address
- url
Default
Source Code
Default value and validation
Custom styles
Source Code
Other Examples
Choose
choose
is a customizable component for browsing a set of items.
Default
Source Code
Custom styles
Source Code
Confirm
confirm
is a customizable component to confirm an anction.
Default
Source Code
Custom styles
Source Code
Toggle
toggle
is a customizable component to confirm an anction. It works like confirm
but it renders the options inline and not in a box.
Default
Source Code
Custom styles
Source Code
ProgressBar
progressbar
is a customizable component for progress meter.
Default
Source Code
Styled
Source Code
🆓 License
prompti is free and open-source software licensed under the MIT License.
Made with Charm.