tui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tui is antares' terminal UI: a colourful, responsive, web-like chat built on Bubble Tea — sidebar, scrollable transcript with Markdown, a bordered input box, a slash-command palette, and toggleable reasoning. The Bubble Tea renderer owns the screen, so resizing and redraws never corrupt the layout.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDemoFrame

func RenderDemoFrame(w, h int) string

RenderDemoFrame renders a single demo frame at the given size — used by the screenshot tool to preview the design.

func RenderModelModalFrame

func RenderModelModalFrame(w, h int) string

RenderModelModalFrame previews the model picker with a seeded provider.

func RenderProviderModalFrame

func RenderProviderModalFrame(w, h int) string

RenderProviderModalFrame previews the provider picker.

func RenderThemeModalFrame

func RenderThemeModalFrame(w, h int) string

RenderThemeModalFrame renders the demo with the theme picker open — used by the screenshot tool to preview the modal.

func RenderWelcomeFrame

func RenderWelcomeFrame(w, h, frame int) string

RenderWelcomeFrame renders the empty-state splash at a given animation frame — used by the screenshot tool to preview the welcome screen.

func ThemeExists

func ThemeExists(name string) bool

ThemeExists reports whether a theme name is known (exported for the CLI).

func ThemeNames

func ThemeNames() []string

ThemeNames lists the available theme names (exported for the CLI).

Types

type Command

type Command struct {
	Name    string
	Summary string
	Run     func(m *Model, args string) (quit bool, cmd tea.Cmd)
}

Command is one slash command.

type Model

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

Model is the Bubble Tea model.

func New

func New(ag *agent.Agent, cfg *config.Config, db store.Store) *Model

New builds a TUI bound to a running agent.

func NewDemo

func NewDemo() *Model

NewDemo builds a self-contained TUI seeded with representative content and no live agent — for previewing the interface (and for hot-reload development). Sending a message produces a canned reply instead of calling a model.

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Run

func (m *Model) Run(ctx context.Context) error

Run takes over the terminal until the user quits.

func (*Model) SetReload added in v0.4.0

func (m *Model) SetReload(fn func() error)

SetReload wires the runtime's reload closure so config changes made from the TUI (model switch, provider connect, theme, /config …) rebuild the same services a dashboard save would. Call once after New; nil is fine (the TUI falls back to a config-only refresh and notes what a restart would apply).

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type Theme

type Theme struct {
	Name   string
	Accent lipgloss.AdaptiveColor // the single highlight (prompt, focus, "you")
	Text   lipgloss.AdaptiveColor
	Muted  lipgloss.AdaptiveColor
	Faint  lipgloss.AdaptiveColor
	Border lipgloss.AdaptiveColor
	Green  lipgloss.AdaptiveColor
	Red    lipgloss.AdaptiveColor
	Yellow lipgloss.AdaptiveColor
}

Theme is a named colour scheme. Everything else in the UI is greyscale; a theme only picks the accent and the neutral ramp, so switching stays calm.

Jump to

Keyboard shortcuts

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