tui

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorBg       = "#1a1b2e"
	ColorPanel    = "#232436"
	ColorBorder   = "#444466"
	ColorTitle    = "#A6E3A1" // green
	ColorModel    = "#CBA6F7" // purple/magenta
	ColorValue    = "#FFFFFF"
	ColorLabel    = "#888899"
	ColorDim      = "#666677"
	ColorOk       = "#A6E3A1"
	ColorDegraded = "#F9E2AF" // yellow
	ColorError    = "#F38BA8" // red
)

Colors (exported for use in CLI help output).

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the root Bubble Tea model for ccmonitor.

func NewModel

func NewModel(opts Options) Model

NewModel creates a new TUI model with the given options.

func (Model) Init

func (m Model) Init() tea.Cmd

Init returns the initial commands for the model.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model.

func (Model) View

func (m Model) View() string

View renders the full TUI layout.

type Options

type Options struct {
	Backend      backend.Backend
	Interval     time.Duration
	NoRateLimits bool
	Minimal      bool
}

Options configures the TUI model.

type SnapshotMsg

type SnapshotMsg struct {
	Snapshot *domain.BackendSnapshot
	Err      error
}

SnapshotMsg carries the result of a collection cycle.

type Styles

type Styles struct {
	App         lipgloss.Style
	Panel       lipgloss.Style
	Title       lipgloss.Style
	Label       lipgloss.Style
	Value       lipgloss.Style
	ModelName   lipgloss.Style
	StatusOk    lipgloss.Style
	StatusWarn  lipgloss.Style
	StatusErr   lipgloss.Style
	Header      lipgloss.Style
	Footer      lipgloss.Style
	Dim         lipgloss.Style
	TableHeader lipgloss.Style
}

Styles holds all lipgloss styles used by the TUI.

func NewStyles

func NewStyles() Styles

NewStyles creates the default style set.

type TabMsg

type TabMsg struct{ Tab int }

TabMsg signals a tab switch.

type TickMsg

type TickMsg struct{}

TickMsg triggers a new data collection cycle.

Jump to

Keyboard shortcuts

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