tui

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

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 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, tea.Cmd)

func (Model) View

func (m Model) View() string

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 logger.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