tui

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

keymap.go declares all keyboard shortcuts used in the TUI. Keeping keybindings in one place makes them easy to document and modify.

model.go defines the Bubble Tea Model — the single source of truth for all TUI state.

Bubble Tea follows The Elm Architecture (TEA):

Model  — what the app knows (state)
Update — how state changes in response to messages
View   — how state is rendered to the terminal

start.go is the entry point into the TUI subsystem. It wires together the Docker client and the Bubble Tea program.

update.go implements the Bubble Tea Update function. It handles all incoming messages (key presses, ticks, fetched data) and returns a new Model + optional Command to run next.

view.go implements the Bubble Tea View function. It converts the current Model state into a string that Bubble Tea renders to the terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(opts StartOptions) error

Start connects to Docker (or uses demo data), builds the model, and runs the TUI. Demo mode runs without a live Docker daemon. Host overrides DOCKER_HOST when non-empty (e.g. "tcp://192.168.1.100:2375").

Types

type KeyMap

type KeyMap struct {
	Up      key.Binding
	Down    key.Binding
	Enter   key.Binding
	Back    key.Binding
	Tab     key.Binding
	Refresh key.Binding
	Logs    key.Binding
	Delete  key.Binding // force-remove a container
	Chart   key.Binding // full-screen stats history chart
	Quit    key.Binding
}

KeyMap holds all named key bindings.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings.

type Model

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

Model is the entire application state.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model. Starts the spinner, first data fetch, and event streaming. Event streaming begins immediately so the timeline is populated from app launch — not deferred to the first Events tab visit.

func (Model) Update

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

Update is called by Bubble Tea whenever a message arrives.

func (Model) View

func (m Model) View() string

View is called by Bubble Tea after every Update to re-render the screen.

type Panel

type Panel int

Panel represents which section of the dashboard is active.

const (
	PanelContainers Panel = iota
	PanelImages
	PanelProblems
	PanelDiskUsage
)
const PanelEvents Panel = PanelProblems

PanelEvents is a compatibility alias for the retired event timeline label.

const PanelNetworks Panel = -1

PanelNetworks is kept as a compatibility sentinel for retired view code.

type Problem added in v0.5.0

type Problem struct {
	Severity       string
	Kind           string
	Name           string
	Detail         string
	Recommendation string
	Since          time.Time
}

Problem is an actionable condition derived from the Docker event stream. Normal lifecycle events are intentionally omitted from this view.

type StartOptions added in v0.8.0

type StartOptions struct {
	Demo         bool
	Host         string
	Version      string
	ComposeFiles []string
}

StartOptions configures the TUI entry point.

type View

type View int

View represents the current screen displayed.

const (
	ViewDashboard View = iota
	ViewDetail
	ViewLogs
	ViewChart
)

Jump to

Keyboard shortcuts

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