https://github.com/sveltinio/prompti
Lightweight and customizable interactive prompt components for Go based CLI.
https://github.com/sveltinio/prompti
bubbletea charmbracelet cli golang prompts
Last synced: about 1 month ago
JSON representation
Lightweight and customizable interactive prompt components for Go based CLI.
- Host: GitHub
- URL: https://github.com/sveltinio/prompti
- Owner: sveltinio
- License: mit
- Created: 2022-08-21T22:55:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-11T02:17:32.000Z (about 1 year ago)
- Last Synced: 2025-03-24T09:05:29.866Z (about 2 months ago)
- Topics: bubbletea, charmbracelet, cli, golang, prompts
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
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](https://github.com/sveltinio/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.
```bash
go get github.com/sveltinio/prompti@latest
```## Prompts
### Input
`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](_examples/input/default/main.go)
### Default value and validation
#### Custom styles
[Source Code](_examples/input/custom-styles/main.go)
#### Other Examples
- [Email](_examples/input/email/main.go)
- [Password](_examples/input/password/main.go)### Choose
`choose` is a customizable component for browsing a set of items.
#### Default
[Source Code](_examples/choose/default/main.go)
#### Custom styles
[Source Code](_examples/choose/custom-styles/main.go)
### Confirm
`confirm` is a customizable component to confirm an anction.
#### Default
[Source Code](_examples/confirm/default/main.go)
#### Custom styles
[Source Code](_examples/confirm/custom-styles/main.go)
### 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](_examples/toggle/default/main.go)
#### Custom styles
[Source Code](_examples/toggle/custom-styles/main.go)
### ProgressBar
`progressbar` is a customizable component for progress meter.
#### Default
[Source Code](_examples/progressbar/default/main.go)
#### Styled
[Source Code](_examples/progressbar/custom-styles/main.go)
## :free: License
prompti is free and open-source software licensed under the MIT License.
***
Made with [Charm](https://charm.sh).