tui

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 35 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run added in v0.13.0

func Run(ctx context.Context, model *Model, input *os.File, output io.Writer) (retErr error)

Run owns terminal input through shutdown and every SSH/unlock handoff. Input is borrowed; only its cancellable duplicate is closed. A nil input selects stdin or opens the controlling terminal when stdin is redirected.

Types

type Model

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

func NewModel

func NewModel(repository *config.Repository, opts ...ModelOption) (Model, error)

NewModel initializes the TUI model. Package components use a no-op logger unless the CLI composition root explicitly supplies one with WithLogger.

func (*Model) Close added in v0.12.0

func (m *Model) Close() error

Close releases all TUI-owned streams and pooled SSH connections.

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) Update

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

func (Model) View

func (m Model) View() tea.View

type ModelOption added in v0.12.0

type ModelOption func(*modelConfig)

ModelOption configures dependencies used by a TUI model.

func WithContext added in v0.12.0

func WithContext(ctx context.Context) ModelOption

WithContext injects the lifetime context for TUI-owned I/O and goroutines.

func WithCredentialPersistenceUnavailable added in v0.12.0

func WithCredentialPersistenceUnavailable(unavailable bool) ModelOption

WithCredentialPersistenceUnavailable keeps connections usable when the CLI cannot initialize automatic saving. Explicit credential edits still fail.

func WithCredentialRegistry added in v0.12.0

func WithCredentialRegistry(reg *credential.Registry) ModelOption

WithCredentialRegistry injects the credential registry used to resolve stored secrets for SSH.

func WithCredentialService added in v0.12.0

func WithCredentialService(svc *credential.Service) ModelOption

WithCredentialService injects the credential service used for secure secret management.

func WithInteractionHandler added in v0.12.0

func WithInteractionHandler(interaction ssh.InteractionHandler) ModelOption

WithInteractionHandler injects SSH prompts run while Bubble Tea has released its terminal. Handlers must not wait on the paused TUI event loop.

func WithLogger added in v0.12.0

func WithLogger(l corelog.DebugLogger) ModelOption

WithLogger injects the debug logger used by TUI-owned package components.

func WithRememberConfirmation added in v0.12.0

func WithRememberConfirmation(confirm func(context.Context, string) (bool, error)) ModelOption

WithRememberConfirmation supplies the UI decision for remember_prompted: ask. Without a confirmer, ask remains session-only. The callback runs with the terminal released and must respect context cancellation.

func WithRememberPolicy added in v0.12.0

func WithRememberPolicy(policy string) ModelOption

WithRememberPolicy overrides automatic recording for this TUI invocation. Explicit credential form edits remain available under never.

func WithVaultControl added in v0.12.0

func WithVaultControl(control func(context.Context, bool) error) ModelOption

WithVaultControl injects process-local lock/unlock actions. Unlock runs with Bubble Tea's terminal released; no master password enters the model state.

Jump to

Keyboard shortcuts

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