tui

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 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 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.

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
}

Styles holds all the styles used in the TUI.

func DefaultStyles

func DefaultStyles() Styles

DefaultStyles returns the default styles.

func (Styles) WithDimensions

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

WithDimensions returns a new Styles with pane dimensions set.

Jump to

Keyboard shortcuts

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