tui

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Status icons
	IconPending = lipgloss.NewStyle().Foreground(colorMuted).Render("◌")
	IconRunning = lipgloss.NewStyle().Foreground(colorCyan).Render("⣾")
	IconDone    = lipgloss.NewStyle().Foreground(colorGreen).Render("✓")
	IconFailed  = lipgloss.NewStyle().Foreground(colorRed).Render("✗")

	// Text styles
	StyleTitle = lipgloss.NewStyle().
				Bold(true).
				Foreground(colorCyan).
				PaddingBottom(1)

	StyleStepName = lipgloss.NewStyle().
					Foreground(colorWhite).
					Width(28)

	StyleDetail = lipgloss.NewStyle().
				Foreground(colorMuted)

	StyleDetailRunning = lipgloss.NewStyle().
						Foreground(colorCyan)

	StyleDetailDone = lipgloss.NewStyle().
					Foreground(colorGreen)

	StyleDetailError = lipgloss.NewStyle().
						Foreground(colorRed)

	StyleURL = lipgloss.NewStyle().
				Foreground(colorYellow).
				Bold(true)

	StyleBox = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(colorBorder).
				Padding(1, 2).
				Width(60)

	StyleSuccessBox = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(colorGreen).
					Padding(1, 2).
					Width(60)

	StyleErrorBox = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(colorRed).
					Padding(1, 2).
					Width(60)

	StyleLabel = lipgloss.NewStyle().
				Foreground(colorMuted).
				Width(20)

	StyleValue = lipgloss.NewStyle().
				Foreground(colorWhite)

	StyleMuted = lipgloss.NewStyle().
				Foreground(colorMuted)

	SpinnerStyle = lipgloss.NewStyle().Foreground(colorCyan)
)

Functions

This section is empty.

Types

type AuthURLMsg

type AuthURLMsg struct{ URL string }

AuthURLMsg is sent mid-setup when Tailscale emits a login URL.

type ProgressMsg

type ProgressMsg struct {
	Index  int
	Status StepStatus
	Detail string
}

ProgressMsg is sent from the setup goroutine to advance TUI state.

type SetupCompleteMsg

type SetupCompleteMsg struct {
	Result *SetupResult
	Err    error
}

SetupCompleteMsg signals that setup finished (success or fail).

type SetupModel

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

SetupModel is the bubbletea model for the `init` command TUI.

func NewSetupModel

func NewSetupModel(stepNames []string, stepFns []func() (string, error)) SetupModel

NewSetupModel creates the model. stepNames and stepFns must be the same length.

func (SetupModel) Init

func (m SetupModel) Init() tea.Cmd

func (SetupModel) IsDone

func (m SetupModel) IsDone() bool

IsDone reports whether the setup flow has completed (success or failure).

func (SetupModel) IsFailed

func (m SetupModel) IsFailed() bool

IsFailed reports whether the setup flow ended in an error.

func (*SetupModel) SetResult

func (m *SetupModel) SetResult(r *SetupResult)

SetResult injects the final result into the model (called from cmd layer).

func (SetupModel) Update

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

func (SetupModel) View

func (m SetupModel) View() string

type SetupResult

type SetupResult struct {
	Domain   string
	Hostname string
	AuthURL  string // non-empty if Tailscale needs manual auth
}

SetupResult is sent when all steps have completed successfully.

type Step

type Step struct {
	Name   string
	Status StepStatus
	Detail string
}

Step holds the display state for a single setup stage.

type StepStatus

type StepStatus int

StepStatus represents the lifecycle state of a setup step.

const (
	Pending StepStatus = iota
	Running
	Done
	Failed
)

Jump to

Keyboard shortcuts

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