Documentation
¶
Index ¶
- type BubbleteaUI
- func (ui *BubbleteaUI) Confirm(prompt string, defaultValue bool) (bool, error)
- func (ui *BubbleteaUI) FilterableSelect(prompt string, options []string) (int, string, error)
- func (ui *BubbleteaUI) NewLine()
- func (ui *BubbleteaUI) RunWithSpinner(message string, operation func() error) error
- func (ui *BubbleteaUI) Select(prompt string, options []string) (int, string, error)
- func (ui *BubbleteaUI) ShowError(err error)
- func (ui *BubbleteaUI) ShowHeading(message string)
- func (ui *BubbleteaUI) ShowInfo(message string)
- func (ui *BubbleteaUI) ShowJSON(data any) error
- func (ui *BubbleteaUI) ShowKeyValue(key, value string)
- func (ui *BubbleteaUI) ShowProgress(message string) func()
- func (ui *BubbleteaUI) ShowSection(heading string, lines ...string)
- func (ui *BubbleteaUI) ShowSuccess(message string)
- func (ui *BubbleteaUI) ShowYAML(data any) error
- func (ui *BubbleteaUI) TextInput(prompt string, defaultValue string, validator func(string) error) (string, error)
- func (ui *BubbleteaUI) Title(message string)
- type FilterableSelectModel
- type Option
- type Provider
- type SelectModel
- type SpinnerModel
- type TextInputModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BubbleteaUI ¶
type BubbleteaUI struct {
// contains filtered or unexported fields
}
BubbleteaUI implementation of the UI Provider interface.
func NewWithOptions ¶
func NewWithOptions(stdout, stderr io.Writer, input io.Reader) *BubbleteaUI
NewWithOptions creates a new UI instance with custom options for testing
func (*BubbleteaUI) Confirm ¶
func (ui *BubbleteaUI) Confirm(prompt string, defaultValue bool) (bool, error)
Confirm asks a yes/no question and returns the user's choice
func (*BubbleteaUI) FilterableSelect ¶
FilterableSelect presents a filterable list of options and returns the selected index and value
func (*BubbleteaUI) RunWithSpinner ¶
func (ui *BubbleteaUI) RunWithSpinner(message string, operation func() error) error
RunWithSpinner runs a function with a bubbletea spinner
func (*BubbleteaUI) Select ¶
Select presents a list of options and returns the selected index and value
func (*BubbleteaUI) ShowError ¶
func (ui *BubbleteaUI) ShowError(err error)
ShowError prints an error message to stderr
func (*BubbleteaUI) ShowHeading ¶
func (ui *BubbleteaUI) ShowHeading(message string)
ShowHeading displays a heading/section title
func (*BubbleteaUI) ShowInfo ¶
func (ui *BubbleteaUI) ShowInfo(message string)
ShowInfo displays an informational message (no emoji, no special formatting)
func (*BubbleteaUI) ShowJSON ¶
func (ui *BubbleteaUI) ShowJSON(data any) error
ShowJSON displays formatted JSON output
func (*BubbleteaUI) ShowKeyValue ¶
func (ui *BubbleteaUI) ShowKeyValue(key, value string)
ShowKeyValue displays a key-value pair with bold key
func (*BubbleteaUI) ShowProgress ¶
func (ui *BubbleteaUI) ShowProgress(message string) func()
ShowProgress displays a progress indicator (spinning dots) and returns a function to stop it
func (*BubbleteaUI) ShowSection ¶
func (ui *BubbleteaUI) ShowSection(heading string, lines ...string)
ShowSection displays a section block with heading and indented content
func (*BubbleteaUI) ShowSuccess ¶
func (ui *BubbleteaUI) ShowSuccess(message string)
ShowSuccess displays a success message
func (*BubbleteaUI) ShowYAML ¶
func (ui *BubbleteaUI) ShowYAML(data any) error
ShowYAML displays formatted YAML output
func (*BubbleteaUI) TextInput ¶
func (ui *BubbleteaUI) TextInput(prompt string, defaultValue string, validator func(string) error) (string, error)
TextInput prompts for text input with optional validation
func (*BubbleteaUI) Title ¶
func (ui *BubbleteaUI) Title(message string)
Title displays a large title with extra spacing
type FilterableSelectModel ¶
type FilterableSelectModel struct {
// contains filtered or unexported fields
}
FilterableSelectModel implements a bubbletea model for filterable selection with a visible text input
func (FilterableSelectModel) Init ¶
func (m FilterableSelectModel) Init() tea.Cmd
Init initializes the filterable select model with cursor blink
func (FilterableSelectModel) View ¶
func (m FilterableSelectModel) View() string
View renders the filterable select model
type Provider ¶
type Provider interface {
// Select presents a list of options and returns the selected index and value
Select(prompt string, options []string) (int, string, error)
// FilterableSelect presents a filterable list of options and returns the selected index and value
FilterableSelect(prompt string, options []string) (int, string, error)
// TextInput prompts for text input with optional validation
TextInput(prompt string, defaultValue string, validator func(string) error) (string, error)
// Confirm asks a yes/no question
Confirm(prompt string, defaultValue bool) (bool, error)
// ShowProgress displays a progress indicator with a message
ShowProgress(message string) func()
// RunWithSpinner runs a function with a bubbletea spinner
RunWithSpinner(message string, operation func() error) error
// ShowInfo displays an informational message (no emoji, no special formatting)
ShowInfo(message string)
// Title displays a large title with extra spacing
Title(message string)
// ShowHeading displays a heading/section title
ShowHeading(message string)
// ShowSection displays a section block with heading and indented content
ShowSection(heading string, lines ...string)
// ShowKeyValue displays a key-value pair with bold key
ShowKeyValue(key, value string)
// NewLine prints a blank line
NewLine()
// ShowError displays an error message
ShowError(err error)
// ShowSuccess displays a success message
ShowSuccess(message string)
// ShowJSON displays formatted JSON output
ShowJSON(data any) error
// ShowYAML displays formatted YAML output
ShowYAML(data any) error
}
Provider provides interactive terminal UI components
type SelectModel ¶
type SelectModel struct {
// contains filtered or unexported fields
}
SelectModel implements a bubbletea model for selecting from a list
type SpinnerModel ¶
type SpinnerModel struct {
// contains filtered or unexported fields
}
SpinnerModel implements a bubbletea model for showing progress
func (SpinnerModel) Init ¶
func (m SpinnerModel) Init() tea.Cmd
Init initializes the spinner model with tick animation
type TextInputModel ¶
type TextInputModel struct {
// contains filtered or unexported fields
}
TextInputModel implements a bubbletea model for text input
func (TextInputModel) Init ¶
func (m TextInputModel) Init() tea.Cmd
Init initializes the text input model with cursor blink
func (TextInputModel) View ¶
func (m TextInputModel) View() string
View renders the text input model