Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StyleBase            lipgloss.Style
	StyleHeader          lipgloss.Style
	StyleSidebarHead     lipgloss.Style
	StyleTaskRowNormal   lipgloss.Style
	StyleTaskRowSelected lipgloss.Style
	StyleTaskName        lipgloss.Style
	StyleTag             lipgloss.Style
	StyleLogHead         lipgloss.Style
	StyleLogName         lipgloss.Style
	StyleLogCmd          lipgloss.Style
	StyleStatusOk        lipgloss.Style
	StyleStatusRunning   lipgloss.Style
	StyleStatusFailed    lipgloss.Style
	StyleStatusIdle      lipgloss.Style
	StyleStatusWarn      lipgloss.Style
	StyleLogDim          lipgloss.Style
	StyleLogOk           lipgloss.Style
	StyleLogErr          lipgloss.Style
	StyleLogInfo         lipgloss.Style
	StyleLogWarn         lipgloss.Style
	StyleLogText         lipgloss.Style
	StyleStatusBar       lipgloss.Style
	StyleKey             lipgloss.Style
	StyleTabActive       lipgloss.Style
	StyleTabInactive     lipgloss.Style
	StyleSectionTitle    lipgloss.Style
	StyleHelp            lipgloss.Style
)

Style variables — populated by initStyles on startup.

View Source
var (
	ThemeCatppuccinMocha = Theme{
		Bg:       "#1a1b1e",
		BgHeader: "#181820",
		Border:   "#2a2b35",
		Selected: "#2a2b3d",
		Text:     "#cdd6f4",
		Dim:      "#45475a",
		Purple:   "#cba6f7",
		Blue:     "#89b4fa",
		Green:    "#a6e3a1",
		Red:      "#f38ba8",
		Yellow:   "#f9e2af",
	}

	ThemeNord = Theme{
		Bg:       "#2e3440",
		BgHeader: "#242933",
		Border:   "#3b4252",
		Selected: "#434c5e",
		Text:     "#eceff4",
		Dim:      "#4c566a",
		Purple:   "#b48ead",
		Blue:     "#88c0d0",
		Green:    "#a3be8c",
		Red:      "#bf616a",
		Yellow:   "#ebcb8b",
	}

	ThemeDracula = Theme{
		Bg:       "#282a36",
		BgHeader: "#21222c",
		Border:   "#44475a",
		Selected: "#44475a",
		Text:     "#f8f8f2",
		Dim:      "#6272a4",
		Purple:   "#bd93f9",
		Blue:     "#8be9fd",
		Green:    "#50fa7b",
		Red:      "#ff5555",
		Yellow:   "#f1fa8c",
	}

	ThemeGruvbox = Theme{
		Bg:       "#282828",
		BgHeader: "#1d2021",
		Border:   "#3c3836",
		Selected: "#504945",
		Text:     "#ebdbb2",
		Dim:      "#665c54",
		Purple:   "#d3869b",
		Blue:     "#83a598",
		Green:    "#b8bb26",
		Red:      "#fb4934",
		Yellow:   "#fabd2f",
	}
)

Built-in named themes.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Up             key.Binding
	Down           key.Binding
	ScrollUp       key.Binding
	ScrollDown     key.Binding
	Run            key.Binding
	Kill           key.Binding
	Clear          key.Binding
	Tab            key.Binding
	Filter         key.Binding
	Help           key.Binding
	Quit           key.Binding
	DeleteHistory  key.Binding
	ToggleSchedule key.Binding
	EditSchedule   key.Binding
	AddTask        key.Binding
}

KeyMap defines all keybindings for the TUI.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default keybindings.

type Model

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

Model is the root Bubbletea model.

func New

func New(cfg *config.Config, st store.Storer, sched *runner.Scheduler, pool *runner.Pool) Model

New creates a new TUI Model.

func (Model) Init

func (m Model) Init() tea.Cmd

Init is called once when the program starts.

func (*Model) StartTaskExternal

func (m *Model) StartTaskExternal(name, trigger string) tea.Cmd

StartTaskExternal allows external code (scheduler) to start a task.

func (Model) Update

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

Update handles incoming messages and returns the updated model and next command.

func (Model) View

func (m Model) View() string

View renders the full TUI.

type ScheduledRunMsg

type ScheduledRunMsg struct {
	TaskName string
	Trigger  string
}

ScheduledRunMsg is sent by the scheduler when a task should run.

type Tab

type Tab int

Tab represents which tab is currently active.

const (
	TabTasks Tab = iota
	TabSchedule
	TabHistory
	TabStats
)

type TaskEntry

type TaskEntry struct {
	Name       string
	Cfg        config.Task
	Status     TaskStatus
	DurationMs int64
	ExitCode   int
}

TaskEntry holds the display state for a single task.

type TaskStatus

type TaskStatus int

TaskStatus represents the current state of a task.

const (
	StatusIdle TaskStatus = iota
	StatusRunning
	StatusSuccess
	StatusFailed
	StatusWatching
)

type Theme added in v0.1.5

type Theme struct {
	Bg       string
	BgHeader string
	Border   string
	Selected string
	Text     string
	Dim      string
	Purple   string
	Blue     string
	Green    string
	Red      string
	Yellow   string
}

Theme holds the color palette used to render the TUI.

func LoadThemeFile added in v0.1.5

func LoadThemeFile(path string) (Theme, error)

LoadThemeFile reads a TOML theme file and returns the resulting Theme. Any field left unset in the file retains the Catppuccin Mocha default, so partial theme files are valid.

func ResolveTheme added in v0.1.5

func ResolveTheme(name string) Theme

ResolveTheme returns the Theme for the given name or path. If name ends in ".toml" it is treated as a file path and loaded with LoadThemeFile. Unknown names and empty strings fall back to Catppuccin Mocha.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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