tui

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tui implements the terminal user interface using Bubble Tea.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorPalette added in v0.2.4

type ColorPalette struct {
	Primary   lipgloss.Color
	Secondary lipgloss.Color
	Text      lipgloss.Color
	Muted     lipgloss.Color
	Local     lipgloss.Color
	Project   lipgloss.Color
	User      lipgloss.Color
	Pending   lipgloss.Color
	Border    lipgloss.Color
}

ColorPalette holds the colors used for styling.

func GetPalette added in v0.2.4

func GetPalette(theme Theme) ColorPalette

GetPalette returns the color palette for the given theme. If ThemeAuto, it detects the terminal background.

type KeyBindings

type KeyBindings struct {
	Up        []string
	Down      []string
	PageUp    []string
	PageDown  []string
	Home      []string
	End       []string
	Enter     []string
	Quit      []string
	Local     []string
	Project   []string
	Toggle    []string
	Uninstall []string
	Enable    []string // Toggle plugin enabled/disabled state
	Escape    []string
	Filter    []string
	Refresh   []string
	Mouse     []string
}

KeyBindings defines all keyboard shortcuts.

func DefaultKeyBindings

func DefaultKeyBindings() KeyBindings

DefaultKeyBindings returns the default key bindings.

type Mode

type Mode int

Mode represents the current UI mode.

const (
	// ModeMain is the default two-pane view.
	ModeMain Mode = iota
	// ModeProgress shows operation progress.
	ModeProgress
	// ModeSummary shows completion summary (both successes and errors).
	ModeSummary
)

type Model

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

Model is the main application model.

func NewModel

func NewModel(client claude.Client, workingDir string) *Model

NewModel creates a new Model with the given client and working directory. Uses auto-detected theme.

func NewModelWithTheme added in v0.2.4

func NewModelWithTheme(client claude.Client, workingDir string, theme Theme) *Model

NewModelWithTheme creates a new Model with the specified theme.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init implements tea.Model.

func (*Model) Update

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

Update implements tea.Model.

func (*Model) View

func (m *Model) View() string

View implements tea.Model.

type Operation

type Operation struct {
	PluginID      string
	Scope         claude.Scope
	OriginalScope claude.Scope  // For uninstalls: the original scope to uninstall from
	Type          OperationType // Operation type: install, uninstall, enable, or disable
}

Operation represents a pending change to execute.

type OperationType

type OperationType int

OperationType represents the type of operation to perform.

const (
	OpInstall OperationType = iota
	OpUninstall
	OpEnable
	OpDisable
)

type PluginState

type PluginState struct {
	Components     *claude.PluginComponents
	Version        string
	Description    string
	AuthorName     string
	AuthorEmail    string
	Marketplace    string
	ID             string
	InstallPath    string
	ExternalURL    string
	InstalledScope claude.Scope
	Name           string
	Enabled        bool
	IsGroupHeader  bool
	IsExternal     bool
}

PluginState holds the display state for a plugin. Fields are ordered for optimal memory alignment (strings/pointers first, bools last).

func PluginStateFromAvailable

func PluginStateFromAvailable(p claude.AvailablePlugin) PluginState

PluginStateFromAvailable creates a PluginState from an available plugin.

func PluginStateFromInstalled

func PluginStateFromInstalled(p claude.InstalledPlugin) PluginState

PluginStateFromInstalled creates a PluginState from an installed plugin. It reads the plugin manifest for description and scans for components.

type Styles

type Styles struct {
	// Pane styles
	LeftPane  lipgloss.Style
	RightPane lipgloss.Style

	// List item styles
	Header      lipgloss.Style
	Selected    lipgloss.Style
	Normal      lipgloss.Style
	GroupHeader lipgloss.Style
	Description lipgloss.Style

	// Scope indicator styles
	ScopeLocal   lipgloss.Style
	ScopeProject lipgloss.Style
	ScopeUser    lipgloss.Style
	Pending      lipgloss.Style

	// Detail pane styles
	DetailTitle       lipgloss.Style
	DetailLabel       lipgloss.Style
	DetailValue       lipgloss.Style
	DetailDescription lipgloss.Style

	// Component list styles
	ComponentCategory lipgloss.Style
	ComponentItem     lipgloss.Style

	// Footer/help
	Help lipgloss.Style

	// Palette holds colors for modal borders and other direct color usage
	Palette ColorPalette
}

Styles holds all the styles used in the TUI. Fields ordered for optimal memory alignment.

func DefaultStyles

func DefaultStyles() Styles

DefaultStyles returns the default styles with auto-detected theme.

func DefaultStylesWithTheme added in v0.2.4

func DefaultStylesWithTheme(theme Theme) Styles

DefaultStylesWithTheme returns styles using the specified theme.

func (Styles) WithDimensions

func (s Styles) WithDimensions(width, height int) Styles

WithDimensions returns a new Styles with pane dimensions set.

type Theme added in v0.2.4

type Theme int

Theme represents the color scheme to use.

const (
	// ThemeAuto detects the terminal background color.
	ThemeAuto Theme = iota
	// ThemeDark uses colors optimized for dark backgrounds.
	ThemeDark
	// ThemeLight uses colors optimized for light backgrounds.
	ThemeLight
)

Jump to

Keyboard shortcuts

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