tui

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCancelled = launch.ErrCancelled

ErrCancelled is returned when the user cancels the selection.

Functions

func RunConfirm

func RunConfirm(prompt string) (bool, error)

RunConfirm shows a bubbletea yes/no confirmation prompt. Returns true if the user confirmed, false if cancelled.

func RunConfirmWithOptions added in v0.20.5

func RunConfirmWithOptions(prompt string, options ConfirmOptions) (bool, error)

RunConfirmWithOptions shows a bubbletea yes/no confirmation prompt with optional custom button labels.

func RunSignIn

func RunSignIn(modelName, signInURL string) (string, error)

RunSignIn shows a bubbletea sign-in dialog and polls until the user signs in or cancels.

func RunSpinner added in v0.32.0

func RunSpinner(message string) *launch.Spinner

RunSpinner runs a bubbletea spinner displaying message until the returned Spinner's Stop is called. Stop signals the program to quit and blocks until it has exited and cleared its line. If the user presses Ctrl+C while the spinner is running, Spinner.Cancelled() is closed so the caller can abort its wait; the program quits and the terminal is restored before Stop returns. RunSpinner returns nil when there is no interactive terminal, so launch.StartSpinner can fall back to its ANSI spinner for headless/--yes runs.

func RunUpgrade added in v0.23.2

func RunUpgrade(modelName, requiredPlan string) (string, error)

RunUpgrade shows a bubbletea upgrade dialog and polls until the user's plan is updated or cancelled.

func SelectMultiple

func SelectMultiple(title string, items []SelectItem, preChecked []string) ([]string, error)

func SelectMultipleWithUpdates added in v0.23.2

func SelectMultipleWithUpdates(title string, items []SelectItem, preChecked []string, updates <-chan []SelectItem) ([]string, error)

func SelectSingle

func SelectSingle(title string, items []SelectItem, current string) (string, error)

func SelectSingleWithUpdates added in v0.23.2

func SelectSingleWithUpdates(title string, items []SelectItem, current string, updates <-chan []SelectItem) (string, error)

Types

type ConfirmOptions added in v0.20.5

type ConfirmOptions = launch.ConfirmOptions

type SelectItem

type SelectItem struct {
	Name              string
	Description       string
	Recommended       bool
	AvailabilityBadge string
}

func ConvertItems

func ConvertItems(items []launch.SelectionItem) []SelectItem

ConvertItems converts launch.SelectionItem slice to SelectItem slice.

func ReorderItems

func ReorderItems(items []SelectItem) []SelectItem

ReorderItems returns a copy with recommended items first, then non-recommended, preserving relative order within each group. This ensures the data order matches the visual section layout (Recommended / More).

type SelectorModel added in v0.32.0

type SelectorModel = selectorModel

func NewModelSelectorModel added in v0.32.0

func NewModelSelectorModel(title string, items []SelectItem, current, filter string) SelectorModel

func NewSelectorModel added in v0.32.0

func NewSelectorModel(title string, items []SelectItem, current string) SelectorModel

type TUIAction added in v0.18.0

type TUIAction struct {
	Kind           TUIActionKind
	Integration    string
	ForceConfigure bool
}

func RunMenu added in v0.18.0

func RunMenu(state *launch.LauncherState) (TUIAction, error)

func (TUIAction) IntegrationLaunchRequest added in v0.18.0

func (a TUIAction) IntegrationLaunchRequest() launch.IntegrationLaunchRequest

func (TUIAction) LastSelection added in v0.18.0

func (a TUIAction) LastSelection() string

func (TUIAction) RunModelRequest added in v0.18.0

func (a TUIAction) RunModelRequest() launch.RunModelRequest

type TUIActionKind added in v0.18.0

type TUIActionKind int
const (
	TUIActionNone TUIActionKind = iota
	TUIActionRunModel
	TUIActionLaunchIntegration
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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