tui

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 12 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 interactive front-end.

It is a front-end, not a second implementation: every screen calls the same internal/app orchestration and internal/ui rendering the commands do, so a behaviour exists in both or neither. Those two packages exist precisely because the first attempt kept the shared helpers in internal/cli, which deadlocked into an import cycle the moment the CLI needed to launch the TUI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Pack is the slug to sync; empty with All set means every pack.
	Pack string
	All  bool

	// DryRun is the Python menu's "Sync all packs (dry-run)".
	DryRun bool
}

Action is what the menu asks the CLI to do once the TUI has exited.

A sync is run outside the alt screen, by the same code path as the `sync` command, so its progress lines and any failure land in the terminal's scrollback rather than vanishing with the TUI -- and so the two front-ends cannot sync differently.

func Run

func Run(configDir string) (*Action, error)

Run starts the TUI and returns the action chosen, if any.

type Model

type Model struct {

	// Action is set when the user chose a sync; Run returns it.
	Action *Action
	// contains filtered or unexported fields
}

Model is the root model and the screen router.

func New

func New(configDir string) *Model

New builds the root model.

func (*Model) Init

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

Init starts the spinner.

func (*Model) Update

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

Update handles input and messages.

func (*Model) View

func (m *Model) View() string

View renders the current screen.

Jump to

Keyboard shortcuts

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