tui

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAborted = errors.New("aborted by user")

ErrAborted is returned when the user quits a TUI screen without confirming.

Functions

func Confirm

func Confirm(title, description string, defaultValue bool) (bool, error)

Confirm asks a yes/no question.

func ConfirmRepos added in v1.1.0

func ConfirmRepos(title string, items []RepoNote) ([]string, error)

ConfirmRepos shows the same multi-select screen with every entry already checked, so the user only has to uncheck what they want to leave out.

func InputPrefilled

func InputPrefilled(title, description, initial string) (string, error)

InputPrefilled asks for optional text with the current value already typed in so it can be edited or deleted. Unlike InputText an empty answer stays empty.

func InputText

func InputText(title, description, defaultValue string) (string, error)

InputText asks for a single line of text. An empty answer falls back to defaultValue, which is also shown as the placeholder.

func InputVersion

func InputVersion(repo string, defaultVersion string) (string, error)

InputVersion shows a text input to edit/confirm the next version of a repo.

func SelectRepos

func SelectRepos(repos []string) ([]string, error)

SelectRepos shows a multi-select screen to choose repositories.

func SelectReposWithPreset added in v1.2.0

func SelectReposWithPreset(repos []string, preset []string) ([]string, error)

SelectReposWithPreset shows the same screen with the given repositories already ticked, so a repeated pass keeps the previous choice. Preset entries that are no longer in the list are ignored.

Types

type PickerAction

type PickerAction int

PickerAction is what the user asked for on the picker screen.

const (
	PickSelected PickerAction = iota
	PickNew
	PickDelete
	PickEdit
)

type PickerItem

type PickerItem struct {
	Label       string
	Description string
}

PickerItem is one selectable row with an optional second line.

type PickerResult

type PickerResult struct {
	Action PickerAction
	Index  int
	Label  string
}

PickerResult reports the chosen action and item.

func Pick

func Pick(title, hint string, items []PickerItem, allowManage bool) (PickerResult, error)

Pick shows a single-select screen. When allowManage is true the new/edit/ delete shortcuts are offered as well.

type RepoNote added in v1.1.0

type RepoNote struct {
	Repo string
	Note string
}

RepoNote pairs a repository with a short annotation rendered next to its name, such as the release that triggered it.

Jump to

Keyboard shortcuts

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