ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorCyan    lipgloss.Color
	ColorMagenta lipgloss.Color
	ColorGreen   lipgloss.Color
	ColorRed     lipgloss.Color
	ColorYellow  lipgloss.Color
	ColorDim     lipgloss.Color

	TitleStyle     lipgloss.Style
	SubtitleStyle  lipgloss.Style
	DimStyle       lipgloss.Style
	ActiveStyle    lipgloss.Style
	InactiveStyle  lipgloss.Style
	SeparatorStyle lipgloss.Style
	DescStyle      lipgloss.Style
	SuccessStyle   lipgloss.Style
	ErrorStyle     lipgloss.Style
	WarnStyle      lipgloss.Style
	BoxStyle       lipgloss.Style
)
View Source
var Version = "dev"

Version is set at build time via ldflags by GoReleaser. Falls back to "dev" when built locally without ldflags.

Functions

func ActiveTheme

func ActiveTheme() string

ActiveTheme returns the currently active theme name.

func Banner() string

func CertBox

func CertBox(width int, lines ...string) string

func CheckUpdate

func CheckUpdate() string

CheckUpdate queries the GitHub API for the latest release. Returns the update message to display, or empty string if up to date. Never blocks longer than 2 seconds; errors are silently ignored.

func ForceTheme

func ForceTheme(name string)

ForceTheme overrides autodetection. Accepts "dark" or "light". Any other value is ignored.

func RenderHelp

func RenderHelp(title string, sections []HelpSection) string

RenderHelp builds a bordered help box from sections.

Usage:

if m.showHelp {
    return ui.RenderHelp("Inspect — Help", []ui.HelpSection{...})
}

func ResultBox

func ResultBox(success bool, title string, lines ...string) string

Types

type FilePicker

type FilePicker struct {
	Prompt string

	Selected string
	Done     bool
	// contains filtered or unexported fields
}

func NewFilePicker

func NewFilePicker(prompt string, patterns ...string) FilePicker

NewFilePicker is a generic constructor. The patterns arg is a list of filename glob patterns (matched with filepath.Match against the filename).

func NewPrivateKeyPicker

func NewPrivateKeyPicker(prompt string) FilePicker

NewPrivateKeyPicker matches SSH private key filenames (excludes *.pub).

func NewSSHCertPicker

func NewSSHCertPicker(prompt string) FilePicker

NewSSHCertPicker matches SSH certificate filenames.

func NewSSHKeyPicker

func NewSSHKeyPicker(prompt string) FilePicker

NewSSHKeyPicker matches any SSH key-related filename (public or private).

func (FilePicker) Init

func (fp FilePicker) Init() tea.Cmd

func (FilePicker) Update

func (fp FilePicker) Update(msg tea.Msg) (FilePicker, tea.Cmd)

func (FilePicker) View

func (fp FilePicker) View() string

type HelpEntry

type HelpEntry struct {
	Key  string
	Desc string
}

HelpEntry is a single (key, description) pair in a help overlay.

type HelpSection

type HelpSection struct {
	Title   string
	Entries []HelpEntry
}

HelpSection groups related help entries under a heading.

func CommonHelp

func CommonHelp() HelpSection

CommonHelp returns entries shared across every screen.

Jump to

Keyboard shortcuts

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