tui

package
v0.213.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package tui is the full-screen Bubble Tea front-end of whisper-cli v2: a btop/k9s- grade dashboard to manage AND watch agents. It reuses internal/client for every control-plane call and internal/model for the view data, so the TUI and the scriptable Cobra surface share ONE implementation (DRY).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(opts Options) error

Run starts the full-screen TUI with the given options and blocks until the user quits. It uses the alt-screen + mouse cell-motion (so the dashboard owns the screen and click/scroll work); on exit it restores the terminal. A start error is returned to the caller (cmd/whisper) to render cleanly - never a panic onto the terminal.

Types

type App

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

App is the root Bubble Tea model. It holds the whole TUI state and folds every message - key, resize, async result, stream event, tick - into a re-render.

func New

func New(opts Options) *App

New builds the root App from resolved options.

func (*App) Init

func (a *App) Init() tea.Cmd

Init kicks off the first fleet load, the render tick, the live stream, and the monitor's op:logs backfill (the merged AGENTS dashboard shows the live monitor from frame one, so its history seed belongs at launch, not behind a tab switch). A launch straight onto EXPLORE (whisper explore [node]) also fires its first live land here, since onEnterMode only runs on a tab SWITCH.

func (*App) SelectedAgent

func (a *App) SelectedAgent() (model.Agent, bool)

SelectedAgent returns the currently-selected agent (zero value when the fleet empty).

func (*App) Update

func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update is the Elm reducer: it folds each message and returns the next command.

func (*App) View

func (a *App) View() string

View renders the whole frame: header, tab bar, the active view, the always-on monitor panel, the footer - with any overlay (palette/modal/help) drawn on top.

type Options

type Options struct {
	Client     *client.Client
	Tenant     string // best-effort tenant handle for the header (opaque t<sha256>)
	Node       string // emitting node hint (e.g. "ns1"); cosmetic
	ThemeName  theme.Name
	NoColor    bool
	Light      bool
	StartAgent string // optional /128 to focus the monitor on at launch
	StartOnMon bool   // launch with the merged dashboard focused on StartAgent (whisper monitor <addr>)

	StartOnExplore bool   // open straight on the EXPLORE tab (whisper explore [node])
	StartNode      string // optional node to land the explorer on (the fetch is not wired yet)

	Version string
}

Options configures a TUI run (resolved once in cmd/whisper).

Directories

Path Synopsis
Package components holds the reusable Lip Gloss render helpers the views compose: the braille sparkline, the gauge, and small formatters.
Package components holds the reusable Lip Gloss render helpers the views compose: the braille sparkline, the gauge, and small formatters.
Package theme is the single styling surface for the whisper TUI.
Package theme is the single styling surface for the whisper TUI.

Jump to

Keyboard shortcuts

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