tui

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StateIcon

func StateIcon(state string) string

StateIcon returns the emoji icon for a session state.

Types

type App

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

App is the top-level Bubble Tea model for OpsDeck.

func NewApp

func NewApp() *App

NewApp creates a new App model. It discovers real Claude Code sessions and falls back to mock data if none are found.

func (*App) Init

func (a *App) Init() tea.Cmd

Init implements tea.Model.

func (*App) Update

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

Update implements tea.Model.

func (*App) View

func (a *App) View() tea.View

View implements tea.Model.

type KeyMap

type KeyMap struct {
	Up           key.Binding
	Down         key.Binding
	Enter        key.Binding
	Search       key.Binding
	Escape       key.Binding
	Refresh      key.Binding
	Quit         key.Binding
	Tab          key.Binding
	FilterState1 key.Binding // waiting
	FilterState2 key.Binding // busy
	FilterState3 key.Binding // idle
	FilterState4 key.Binding // dead
	FilterClear  key.Binding // clear filter
}

KeyMap defines all key bindings for the TUI.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings.

type Session

type Session struct {
	ID             string
	PID            int
	State          string
	Project        string
	StartedAt      time.Time
	WorkingOn      string
	LastLine       string // last line of transcript (preview)
	TranscriptPath string // path to transcript JSONL for detail panel
	GitBranch      string // current git branch (empty if not a repo)
	GitDirty       bool   // true if working tree has uncommitted changes
}

Session represents a Claude Code session discovered on the system.

func DiscoverSessions

func DiscoverSessions() []Session

DiscoverSessions scans for real Claude Code sessions and returns them as TUI Session values.

type Styles

type Styles struct {
	// Title bar at the very top.
	TitleBar lipgloss.Style

	// Status bar (bottom).
	StatusBar     lipgloss.Style
	StatusKey     lipgloss.Style
	StatusValue   lipgloss.Style
	StatusDivider lipgloss.Style

	// State badges.
	BadgeWaiting lipgloss.Style
	BadgeBusy    lipgloss.Style
	BadgeIdle    lipgloss.Style
	BadgeDead    lipgloss.Style
	BadgePaused  lipgloss.Style
	BadgeUnknown lipgloss.Style

	// Project header row.
	ProjectHeader lipgloss.Style

	// Session table rows.
	RowNormal   lipgloss.Style
	RowSelected lipgloss.Style

	// Detail panel (transcript preview).
	DetailPanel  lipgloss.Style
	DetailBorder lipgloss.Style
	DetailTitle  lipgloss.Style

	// Search input.
	SearchPrompt lipgloss.Style
	SearchText   lipgloss.Style

	// Help bar.
	HelpKey  lipgloss.Style
	HelpDesc lipgloss.Style
	HelpSep  lipgloss.Style
}

Styles holds all the lipgloss styles used by the TUI.

func DefaultStyles

func DefaultStyles() Styles

DefaultStyles returns the default set of styles for the TUI.

func (Styles) StateBadge

func (s Styles) StateBadge(state string, count int) string

StateBadge returns a styled badge string for a given state and count.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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