tui

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(tapePath string) error

Run launches the TUI, reading connection settings from Viper (same source as CLI commands). When tapePath is non-empty, all keystrokes are recorded to a VHS-compatible .tape file.

func RunLogin

func RunLogin(hostname string) error

RunLogin launches the inline login wizard for the given hostname.

Types

type LoginModel

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

LoginModel is a self-contained Bubble Tea model for the inline login wizard.

func (LoginModel) Init

func (m LoginModel) Init() tea.Cmd

func (LoginModel) Update

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

func (LoginModel) View

func (m LoginModel) View() tea.View

type Model

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

Model is the root TUI model. All state lives here per the ELM architecture.

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 TapeRecorder

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

TapeRecorder writes a VHS-compatible .tape file as the user interacts with the TUI. Every keypress is recorded with the elapsed time since the previous keypress as a Sleep command.

func NewTapeRecorder

func NewTapeRecorder(path string) (*TapeRecorder, error)

NewTapeRecorder creates a TapeRecorder that writes to path. The file is created (or truncated) immediately; the tape header is written on the first call to WriteHeader (triggered by the first tea.WindowSizeMsg).

func (*TapeRecorder) Flush

func (r *TapeRecorder) Flush()

Flush writes any remaining buffered Type text and closes the file. Call this after the Bubble Tea program exits.

func (*TapeRecorder) Record

func (r *TapeRecorder) Record(msg tea.KeyPressMsg)

Record writes the VHS command for a keypress, preceded by a Sleep that reflects how long has passed since the previous keypress.

func (*TapeRecorder) WriteHeader

func (r *TapeRecorder) WriteHeader()

WriteHeader writes the VHS tape header to the file. It is idempotent — only the first call has effect. Call this once the terminal size is known (from WindowSizeMsg).

Jump to

Keyboard shortcuts

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