tui

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 15 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 the `wtm tui` dashboard. It knows nothing of git, docker or the registry: everything it shows comes through the Source it is handed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

func New

func New(ctx context.Context, project string, src Source) Model

New starts loading: Init sends the first listing, so nothing else may.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

type Source

type Source struct {
	List           func(ctx context.Context) ([]worktree.Entry, error)
	Ports          func(ctx context.Context, branch string) ([]string, error)
	InspectRemoval func(ctx context.Context, branch string) (worktree.RemovalPlan, error)
	// Wtm runs this very binary. The lifecycle verbs are handed the terminal
	// rather than called in-process: docker streams straight to stdout, and a
	// start may ask about memory.
	Wtm func(args ...string) *exec.Cmd
	// Open hands a URL to the desktop's browser.
	Open func(url string) error
	// Memory is the warning `wtm start` prints when memory is tight, empty when
	// it is not. A start in the panel has no terminal to ask from, so the
	// dashboard asks before it runs.
	Memory func(ctx context.Context) (string, error)
}

Source is what the dashboard asks, the same questions `wtm list` and `wtm ports` answer.

Jump to

Keyboard shortcuts

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