4

GitHub - cqroot/prompt: User-friendly interactive prompts for Go.

 1 year ago
source link: https://github.com/cqroot/prompt
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Prompt

User-friendly interactive prompts for Go.
Based on Bubble Tea. Inspired by Prompts and Gum.

example

Table of Contents

Features

  1. choose lets the user choose one of several strings using the terminal ui.
  2. multichoose lets the user choose multiple strings from multiple strings using the terminal ui.
  3. input lets the user enter a string using the terminal ui. You can specify that only numbers or integers are allowed.
  4. Show help message for keymaps.
  5. Based on Bubble Tea. prompt.Prompt and all child models implement tea.Model.

Screenshots

Choose

Theme Default

example

choose

Theme Arrow

example

choose-theme-arrow

Theme Line

example

choose-theme-line

MultiChoose

Theme Default

example

multichoose

Theme Dot

example

multichoose-theme-dot

Input

example

input

Password input

example

input-echo-password

Password input like linux (do not display any characters)

example

input-echo-none

Only integers can be entered

example

Only numbers can be entered

example

Input with validation

example

input-with-validation

Write

example

write

Show help message

All components support displaying help message for shortcut keys at the bottom.

choose-with-help

Examples:

License

MIT License.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK