tui

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 45 Imported by: 0

Documentation

Overview

Package tui is tau's interactive terminal interface, built on Bubble Tea.

The design point that shapes everything else: tau renders inline instead of taking over the alternate screen. Completed messages are printed into the terminal's own scrollback and never touched again; only the live region — streaming output, the editor, and the status line — is repainted. Your scrollback, selection, and search keep working, and transcript length costs nothing to render.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opts Options) error

Run starts the interactive TUI and blocks until the user exits.

Construction order matters. The UI bridge exists before the coding session so extensions can reach the UI from inside their factory, and the Bubble Tea program is attached to the bridge before it starts, so no dialog can be requested against a program that is not listening yet.

Types

type Options

type Options struct {
	// Coding carries everything coding.New needs except the UI wiring, which
	// Run supplies.
	Coding coding.Options
}

Options configures the interactive session.

type Theme

type Theme struct {
	// Name is the loaded theme's name.
	Name string
	// Colors is the theme the styles were built from; never nil.
	Colors *theme.Theme

	User      lipgloss.Style
	Assistant lipgloss.Style
	Thinking  lipgloss.Style
	ToolName  lipgloss.Style
	ToolArgs  lipgloss.Style
	ToolOut   lipgloss.Style
	Error     lipgloss.Style
	Warning   lipgloss.Style
	Success   lipgloss.Style
	Dim       lipgloss.Style
	Accent    lipgloss.Style
	Bold      lipgloss.Style
	Prompt    lipgloss.Style
	BashMode  lipgloss.Style
	Status    lipgloss.Style
	Selected  lipgloss.Style
	Border    lipgloss.Style
	DialogBox lipgloss.Style
}

Theme is the TUI's palette: the handful of lipgloss styles the interface paints with, derived from a loaded theme.

The styles are a projection, not the whole theme — Colors keeps the full token set so the markdown renderer, diff views, and the HTML export can read the tokens they need without going back through here.

func DefaultTheme

func DefaultTheme() Theme

DefaultTheme is the built-in dark palette, used when nothing has been configured and by tests that do not care which theme they render under.

func FromTheme added in v0.15.0

func FromTheme(t *theme.Theme) Theme

FromTheme builds the TUI palette from a loaded theme. A nil theme falls back to the built-in dark one.

Where tau's interface has no counterpart to a Pi token — tau marks the selected row with "▸ " rather than a filled background, for instance — the nearest foreground token is used, so a theme written for Pi still reads the way its author intended.

func LoadTheme added in v0.15.0

func LoadTheme(setting string, opts theme.Options) (Theme, []string)

LoadTheme resolves the configured theme setting against the discovered themes and builds the palette. It returns the palette and one warning line per theme that could not be loaded or was asked for and not found — the caller decides where those go.

Jump to

Keyboard shortcuts

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