Documentation
¶
Overview ¶
Package tui provides a reusable list picker for CLI list subcommands.
It wraps bubbletea/bubbles/list to render a scrollable/filterable list of items with arrow-key navigation, `/` filter (built-in), `c` to copy the selected item's ID to the system clipboard, `enter` to return the selection to the caller, and `q`/`ctrl+c` to quit without selecting.
The caller is responsible for rendering the detail view after the TUI exits — this package does not show details itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
Item is a selectable row. ID is what `c` copies and what is returned to the caller when the user selects the row. TitleText and DescText are shown in the list; FilterText (optional) is matched by `/`.
func (Item) Description ¶
Description implements list.DefaultItem.
type ListConfig ¶
ListConfig configures a list session.
type Result ¶
type Result struct {
// SelectedID is set to the chosen item's ID if the user pressed enter.
// Empty when the user quit without selecting.
SelectedID string
}
Result carries the outcome of a list session.
func RunList ¶
func RunList(cfg ListConfig) (Result, error)
RunList displays the list picker and blocks until the user quits or selects an item. On selection, returns the chosen ID. On quit, returns an empty ID.