Documentation
¶
Overview ¶
Package tui draws codexctl's prompts and styled output. It knows nothing about profiles or Codex.
Index ¶
- Variables
- func Confirm(env Env, opts ConfirmOptions) (bool, error)
- func Input(env Env, opts InputOptions) (string, error)
- func MultiSelect(env Env, opts MultiSelectOptions) ([]int, error)
- func RunSteps(env Env, steps ...Step) error
- func Select(env Env, opts SelectOptions) (int, error)
- func Spin(env Env, title string, run func() error) error
- type Action
- type Check
- type ConfirmOptions
- type DashboardChoice
- type DashboardOptions
- type DashboardRow
- type Env
- type Field
- type InputOptions
- type Item
- type Level
- type Meter
- type MultiSelectOptions
- type Note
- type Reporter
- type Row
- type Screen
- type SelectOptions
- type Step
- type Theme
- func (t *Theme) Card(title string, badges []string, fields []Field) string
- func (t *Theme) Checklist(checks []Check) string
- func (t *Theme) Failure(message string) string
- func (t *Theme) Hint(message string) string
- func (t *Theme) Meter(left float64, width int) string
- func (t *Theme) Name(name string) string
- func (t *Theme) Success(message string) string
- func (t *Theme) Table(header []string, rows []Row) string
- func (t *Theme) Warning(message string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelled = errors.New("cancelled")
Functions ¶
func MultiSelect ¶
func MultiSelect(env Env, opts MultiSelectOptions) ([]int, error)
Types ¶
type ConfirmOptions ¶
type DashboardChoice ¶
DashboardChoice has an empty Key when the user quit.
type DashboardOptions ¶
type DashboardOptions struct {
Title string
Subtitle string
Notes []Note // shown under the title
Rows []DashboardRow
Results []Note // what the last action reported
Actions []Action
Cursor int
// Load runs in the background and its rows replace Rows.
Load func() []DashboardRow
}
type DashboardRow ¶
type InputOptions ¶
type MultiSelectOptions ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter is safe to call from the step's goroutine. The zero Reporter discards everything.
func (*Reporter) Context ¶
Context is cancelled on Ctrl-C; the runner waits for the step either way.
type Screen ¶ added in v0.3.1
type Screen struct {
// contains filtered or unexported fields
}
Screen is the alternate screen, held while the dashboard is open so it stays in place.
func OpenScreen ¶ added in v0.3.1
func (*Screen) Dashboard ¶ added in v0.3.1
func (s *Screen) Dashboard(opts DashboardOptions) (DashboardChoice, error)
type SelectOptions ¶
type Theme ¶
type Theme struct {
Title lipgloss.Style
Text lipgloss.Style
Muted lipgloss.Style
Faint lipgloss.Style
Accent lipgloss.Style
OK lipgloss.Style
Warn lipgloss.Style
Err lipgloss.Style
Key lipgloss.Style
Cursor lipgloss.Style
Selected lipgloss.Style
Header lipgloss.Style
Box lipgloss.Style
Badge lipgloss.Style
Button lipgloss.Style
ButtonOn lipgloss.Style
Danger lipgloss.Style
// contains filtered or unexported fields
}
Theme is bound to one output stream, so a pipe or NO_COLOR gets plain text.
Click to show internal directories.
Click to hide internal directories.