An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        


prompti



Lightweight and customizable interactive prompt components for Go based CLI.




license

 

go report card

 

go reference

 

sveltin cli version

**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)

Input example

### Default value and validation

Input example with default value and validation

#### Custom styles

[Source Code](_examples/input/custom-styles/main.go)

Input example with custom styles

#### 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)

Choose example

#### Custom styles

[Source Code](_examples/choose/custom-styles/main.go)

Choose example with custom styles

### Confirm

`confirm` is a customizable component to confirm an anction.

#### Default

[Source Code](_examples/confirm/default/main.go)

Confirm example

#### Custom styles

[Source Code](_examples/confirm/custom-styles/main.go)

Confirm example with custom styles

### 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)

Toggle example

#### Custom styles

[Source Code](_examples/toggle/custom-styles/main.go)

Toggle example with custom styles

### ProgressBar

`progressbar` is a customizable component for progress meter.

#### Default

[Source Code](_examples/progressbar/default/main.go)

ProgressBar example

#### Styled

[Source Code](_examples/progressbar/custom-styles/main.go)

ProgressBar example

## :free: License

prompti is free and open-source software licensed under the MIT License.

***
Made with [Charm](https://charm.sh).