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

tui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package tui renders Ghost's terminal interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	HandlePoll(poller.Result)
	Snapshot() engine.Snapshot
	PRState(repo string, number int) engine.PRState
	Rereview(github.PR) error
	PostPending(ctx context.Context, repo string, number int) error
	TogglePause() bool
	Changes() <-chan struct{}
	Approve(ctx context.Context, repo string, number int) error
}

Engine is what the TUI needs from the review engine.

type Model

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

func New

func New(o Options) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

Update handles msg, then refreshes cached engine state for messages that can change it, so View never touches the database.

func (Model) View

func (m Model) View() tea.View

type Options

type Options struct {
	Views           []config.View
	MaxDailyCostUSD float64
	Checks          []preflight.Result
	Results         <-chan poller.Result // nil when polling is disabled
	PollNow         func()
	PollDisabled    string // why polling is off; shown in empty lists
	OpenURL         func(string) error
	Engine          Engine                    // nil: browse only
	SaveViews       func([]config.View) error // persists views; nil disables n/e/d
	Theme           string                    // config theme; "" = dark
	NoColor         bool                      // NO_COLOR set: force mono
	ConfigPath      string                    // shown when suggesting a theme setting
	Themes          *theme.Registry           // available themes; nil = built-ins only
	Agents          []string                  // agent names for the view form
	ReviewLabel     string                    // review_label: the view form's default
	MaxPRsPerView   int                       // max_prs_per_view: the view form's default
}

Jump to

Keyboard shortcuts

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