tui

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PathColor = "[light_blue]"
View Source
var (
	SpinnerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("69"))
)
View Source
var TitleColor = "[magenta]"

Functions

func AskQuestion added in v0.5.6

func AskQuestion(question string, defaultAnswer string) string

func AskSecret added in v0.8.0

func AskSecret(question string) (string, bool)

AskSecret asks for a value which is not displayed while it is typed. The second result is false when the question was cancelled, which has to be told apart from an empty answer : escaping out of a prompt must never store an empty token.

func PickSeveral added in v0.8.0

func PickSeveral(title string, items []MultiItem, preselected map[int]bool) ([]string, bool)

PickSeveral asks for several items of a list to be picked. The second result is false when the list was cancelled.

func TheEndMessage

func TheEndMessage() tea.Cmd

Types

type ChoiceModel

type ChoiceModel struct {
	// contains filtered or unexported fields
}

func InitialChoiceModel

func InitialChoiceModel(title string, choices []string) ChoiceModel

func (ChoiceModel) Init

func (m ChoiceModel) Init() tea.Cmd

func (ChoiceModel) Picked

func (m ChoiceModel) Picked() string

func (ChoiceModel) Update

func (m ChoiceModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ChoiceModel) View

func (m ChoiceModel) View() string

type ErrorMessage

type ErrorMessage struct {
	Error string
}

type InfoMessage added in v0.5.4

type InfoMessage struct {
	Message string
}

type InputModel

type InputModel struct {
	TextInput textinput.Model

	// Cancelled tells that the question was left with escape or ctrl+c instead of being answered.
	// Without it an empty answer and a cancel look the same, which must never happen for a secret.
	Cancelled bool
	// contains filtered or unexported fields
}

func InitialInputModel

func InitialInputModel(q string, ph string) InputModel

func InitialSecretInputModel added in v0.8.0

func InitialSecretInputModel(q string) InputModel

InitialSecretInputModel asks for a value which must not be displayed while it is typed, such as a token or the passphrase of an ssh key

func (InputModel) Init

func (m InputModel) Init() tea.Cmd

func (InputModel) Update

func (m InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (InputModel) View

func (m InputModel) View() string
type MenuModel struct {
	Selected map[int]entity.GitFolder // which to-do items are Selected
	// contains filtered or unexported fields
}

func InitialMenuModel

func InitialMenuModel(question string, choices []entity.GitFolder) MenuModel
func (m MenuModel) Init() tea.Cmd
func (m MenuModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
func (m MenuModel) View() string

type MultiItem added in v0.8.0

type MultiItem struct {
	// Label is what is picked, and what Picked returns
	Label string
	// Hint is displayed next to the label, dimmed. It must never hold a secret.
	Hint string
}

MultiItem is one line of a list several of which can be picked

type MultiModel added in v0.8.0

type MultiModel struct {
	Cancelled bool
	// contains filtered or unexported fields
}

MultiModel lets several items of a list be picked. MenuModel does the same for the git folders of the interactive git-info, but it is tied to that type.

func InitialMultiModel added in v0.8.0

func InitialMultiModel(title string, items []MultiItem, preselected map[int]bool) MultiModel

InitialMultiModel builds the list. The items of preselected start out picked, which is how the platforms needing attention are offered first.

func (MultiModel) Init added in v0.8.0

func (m MultiModel) Init() tea.Cmd

func (MultiModel) Picked added in v0.8.0

func (m MultiModel) Picked() []string

Picked returns the labels of the picked items, in the order of the list

func (MultiModel) Update added in v0.8.0

func (m MultiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (MultiModel) View added in v0.8.0

func (m MultiModel) View() string

type PrintMessage

type PrintMessage struct {
	Path string
}

type SpinnerModel

type SpinnerModel struct {
	Spinner spinner.Model

	Text  string
	Warns []string
	// contains filtered or unexported fields
}

func (SpinnerModel) Init

func (m SpinnerModel) Init() tea.Cmd

func (SpinnerModel) Update

func (m SpinnerModel) Update(msg2 tea.Msg) (tea.Model, tea.Cmd)

func (SpinnerModel) View

func (m SpinnerModel) View() string

View renders the spinner and instructions

type UpdateMessage added in v0.6.0

type UpdateMessage struct {
	Message string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址