tui

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package tui implements suve's terminal UI — a third frontend beside the CLI and the Wails GUI. It is pure Go and untagged, so it ships in the default CLI build. Like the GUI it consumes internal/usecase/* over the provider Registry and the neutral internal/capability matrix; unlike the GUI, provider and scope are fixed at launch (no in-app switching). This file holds the root model — the app shell that owns the status bar, tab bar, help bar, and the page and dialog stacks, and dispatches every message in the order dialogs → global keys → active page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, scope provider.Scope, service string) error

Run starts the TUI for a fixed provider scope and initial service. Provider and scope are resolved by the caller (the --tui launch wiring) and never change for the process lifetime — relaunch to switch. service preselects the initial tab ("param"/"secret", or "" for the group default). It mirrors the GUI's Run entry shape (internal/gui/run.go) adapted to the terminal.

Types

type App

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

App is the root Bubble Tea model — the app shell.

func (*App) Init

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

Init kicks off the async AWS identity fetch (AWS scope only) and the initial page's own loads.

func (*App) Update

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

Update dispatches messages. Input (keys, mouse) is routed dialogs-first, then through the global key map, then to the active page. Window resizes fan out to the active page and every dialog; async identity results update the status bar.

func (*App) View

func (m *App) View() tea.View

View composes the shell and returns a tea.View that also carries the program-level toggles (alt-screen and mouse capture) Bubble Tea v2 reads from the returned view each frame.

Directories

Path Synopsis
Package components holds the leaf render widgets of the TUI app shell: the status bar and the tab bar.
Package components holds the leaf render widgets of the TUI app shell: the status bar and the tab bar.
Package data is the TUI's read-path data seam.
Package data is the TUI's read-path data seam.
Package dialogs implements the TUI's modal mutation dialogs: the create/edit entry form (a charm.land/huh/v2 form embedded as a model, with a $EDITOR handoff), the delete confirm, the tag add/remove form, the restore form, and a plain error dialog.
Package dialogs implements the TUI's modal mutation dialogs: the create/edit entry form (a charm.land/huh/v2 form embedded as a model, with a $EDITOR handoff), the delete confirm, the tag add/remove form, the restore form, and a plain error dialog.
Package hit provides compositor-based mouse hit-testing for the TUI's pages and dialogs.
Package hit provides compositor-based mouse hit-testing for the TUI's pages and dialogs.
Package keys defines the TUI's global key map on bubbles/v2/key, plus its bubbles/v2/help integration.
Package keys defines the TUI's global key map on bubbles/v2/key, plus its bubbles/v2/help integration.
Package nav holds the upward navigation messages a page emits to the app shell.
Package nav holds the upward navigation messages a page emits to the app shell.
pages
browser
Package browser implements the master-detail entry browser shared by the Param and Secret tabs: a filterable entry list on the left and, on the right, the selected entry's masked value, capability-gated metadata, read-only tags, and version history.
Package browser implements the master-detail entry browser shared by the Param and Secret tabs: a filterable entry list on the left and, on the right, the selected entry's masked value, capability-gated metadata, read-only tags, and version history.
diff
Package diff renders the TUI's diff page: two versions of one entry compared with github.com/aymanbagabas/go-udiff (the same engine the CLI uses), colorized per line in a scrollable viewport.
Package diff renders the TUI's diff page: two versions of one entry compared with github.com/aymanbagabas/go-udiff (the same engine the CLI uses), colorized per line in a scrollable viewport.
staging
Package staging implements the TUI's staging review page: per-service sections listing staged entries (as Remote-vs-Staged diffs or raw staged values) and independent staged tag changes, with unstage (`u`, the single removal affordance for both entries and tag changes) / edit-staged row actions and the apply and reset flows.
Package staging implements the TUI's staging review page: per-service sections listing staged entries (as Remote-vs-Staged diffs or raw staged values) and independent staged tag changes, with unstage (`u`, the single removal affordance for both entries and tag changes) / edit-staged row actions and the apply and reset flows.
Package styles holds the single Styles struct that every TUI component draws with, built on lipgloss v2.
Package styles holds the single Styles struct that every TUI component draws with, built on lipgloss v2.
Package termquirk detects terminal environments that need rendering workarounds in the TUI, and provides the repaint helper those workarounds use.
Package termquirk detects terminal environments that need rendering workarounds in the TUI, and provides the repaint helper those workarounds use.

Jump to

Keyboard shortcuts

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