ui

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package ui implements the bubbletea TUI application, views, and modal dialogs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEditorCmd

func NewEditorCmd(tmpPath string) *editorCmd

NewEditorCmd creates a command that opens the given temp file in $EDITOR.

func NewExecWrap

func NewExecWrap(pluginPath string, args []string) *execWrapCmd

func ParseScaleInput

func ParseScaleInput(value string) (int, error)

func RenderHelp

func RenderHelp(lines []struct{ key, desc string }, width int) string

RenderHelp renders a context-sensitive help overlay from the provided keybinding lines.

Types

type App

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

func NewApp

func NewApp(client *e9saws.Client, cfg *config.Config, defaultCluster string, refreshSec int) App

func (App) Init

func (a App) Init() tea.Cmd

func (App) Update

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

func (App) View

func (a App) View() string

type ConfirmAction

type ConfirmAction int
const (
	ConfirmNone ConfirmAction = iota
	ConfirmForceDeploy
	ConfirmStopTask
	ConfirmScaleInToggle
	ConfirmSSMUpdate
	ConfirmSMUpdate
	ConfirmDynamoFieldEdit
	ConfirmDynamoClone
	ConfirmSMClone
	ConfirmSQSDelete
	ConfirmSQSSend
	ConfirmCBStartBuild
	ConfirmCBStopBuild
	ConfirmEC2Start
	ConfirmEC2Stop
	ConfirmEC2Reboot
	ConfirmEC2Terminate
	ConfirmLambdaCodeUpdate
	ConfirmR53Create
	ConfirmR53Update
	ConfirmR53Delete
	ConfirmECRDelete
)

type ConfirmModel

type ConfirmModel struct {
	Active  bool
	Action  ConfirmAction
	Message string
}

func NewConfirm

func NewConfirm(action ConfirmAction, message string) ConfirmModel

func (ConfirmModel) Update

func (m ConfirmModel) Update(msg tea.Msg) (ConfirmModel, tea.Cmd)

func (ConfirmModel) View

func (m ConfirmModel) View() string

type ConfirmResultMsg

type ConfirmResultMsg struct {
	Action    ConfirmAction
	Confirmed bool
}

type HelpModel

type HelpModel struct {
	Active bool
}

type InputAction

type InputAction int
const (
	InputNone InputAction = iota
	InputScale
	InputSSMPath
	InputSSMSaveName
	InputExecCommand
	InputLogGroupPrefix
	InputLogSearchPattern
	InputLogSaveName
	InputSSMEditValue
	InputLogSaveFile
	InputSMFilter
	InputSMSaveName
	InputSMEditValue
	InputS3Search
	InputS3SaveName
	InputS3Download
	InputLambdaSearch
	InputLambdaSaveName
	InputDynamoSearch
	InputDynamoSaveName
	InputDynamoFilterAttr
	InputDynamoFilterValue
	InputDynamoPartiQL
	InputDynamoQuerySaveName
	InputS3KeySearch
	InputSMCloneName
	InputSQSSearch
	InputSQSSaveName
	InputLogSearchFrom
	InputLogSearchTo
	InputLogSearchGroupsSave
	InputTofuDir
	InputTofuSaveName
)

type InputModel

type InputModel struct {
	Active bool
	Action InputAction
	Label  string
	// contains filtered or unexported fields
}

func NewInput

func NewInput(action InputAction, label, defaultValue string) InputModel

func (InputModel) Update

func (m InputModel) Update(msg tea.Msg) (InputModel, tea.Cmd)

func (InputModel) View

func (m InputModel) View() string

type InputResultMsg

type InputResultMsg struct {
	Action   InputAction
	Value    string
	Canceled bool
}

type KeyBindings added in v0.6.0

type KeyBindings struct {
	// Global
	SwitchMode   string
	ReopenPicker string
	PauseResume  string
	EditConfig   string
	SwitchRegion string

	// ECS
	ForceRedeploy   string
	Scale           string
	ServiceDetail   string
	ServiceLogs     string
	Metrics         string
	StandaloneTasks string
	TaskLogs        string
	StopTask        string
	ECSExec         string
	EnvVars         string
	ToggleScaleIn   string

	// Log viewer
	LogFollow     string
	LogTimestamp  string
	LogOlder      string
	LogNewer      string
	LogCopy       string
	LogOpenEditor string
	LogSave       string

	// CloudWatch Logs
	TailStream    string
	TailGroup     string
	BrowseStreams string
	SavePath      string

	// CloudWatch Alarms
	ToggleActions string
	SetAlarmState string

	// SSM / SM
	EditValue   string
	CloneSecret string
	CopyARN     string

	// S3
	Download string

	// Lambda
	EditCode string

	// DynamoDB
	FilterScan string
	PartiQL    string
	NextPage   string
	EditField  string
	CloneItem  string

	// SQS
	Messages     string
	PollMessages string
	SendMessage  string
	CloneSend    string
	DeleteMsg    string
	NavigateDLQ  string

	// CodeBuild
	StartBuild string
	StopBuild  string
	ViewLogs   string

	// EC2
	SSMSession     string
	ConsoleOutput  string
	StartInstance  string
	StopInstance   string
	RebootInstance string
	TermInstance   string

	// Route53
	TestDNS      string
	EditRecord   string
	DeleteRecord string
	NewRecord    string

	// ECR
	StartScan   string
	CopyURI     string
	DeleteImage string

	// OpenTofu
	RunPlan  string
	RunApply string
	RunInit  string

	// Shared
	Save      string // W — save/bookmark
	Search    string // s — general search/find
	Timestamp string // t — toggle timestamps
}

KeyBindings holds all configurable key bindings. Each field is the key string that msg.String() returns (e.g. "ctrl+s", "e", "`", "W"). Defaults are set in NewKeyBindings, then overridden from config.

func NewKeyBindings added in v0.6.0

func NewKeyBindings() KeyBindings

NewKeyBindings returns KeyBindings with all defaults.

func (*KeyBindings) ApplyOverrides added in v0.6.0

func (kb *KeyBindings) ApplyOverrides(overrides map[string]string)

ApplyOverrides applies user-configured key overrides from the config map.

type ModeSaveDefaultMsg

type ModeSaveDefaultMsg struct {
	Mode topMode
}

ModeSaveDefaultMsg is sent when the user wants to save the current mode as default.

type ModeSwitchSelectedMsg

type ModeSwitchSelectedMsg struct {
	Mode topMode
}

ModeSwitchSelectedMsg is sent when the user picks a mode.

type ModeSwitcherModel

type ModeSwitcherModel struct {
	Active bool
	// contains filtered or unexported fields
}

func NewModeSwitcher

func NewModeSwitcher(tabs []ModeTab, current topMode) ModeSwitcherModel

func (ModeSwitcherModel) Update

func (m ModeSwitcherModel) Update(msg tea.Msg) (ModeSwitcherModel, tea.Cmd)

func (ModeSwitcherModel) View

func (m ModeSwitcherModel) View() string

type ModeTab

type ModeTab struct {
	Mode  topMode
	Label string
	Key   string
}

ModeTab represents an enabled module tab.

type PathInput added in v0.5.0

type PathInput struct {
	Action InputAction
	Prompt string
	// contains filtered or unexported fields
}

PathInput provides a directory path input with filesystem completion. Type to filter, Tab/Down/Up to navigate suggestions, Enter to select.

func NewPathInput added in v0.5.0

func NewPathInput(action InputAction, prompt, defaultVal string) PathInput

func (PathInput) Update added in v0.5.0

func (p PathInput) Update(msg tea.Msg) (PathInput, tea.Cmd)

func (PathInput) View added in v0.5.0

func (p PathInput) View() string

type PathInputCancelMsg added in v0.5.0

type PathInputCancelMsg struct{}

PathInputCancelMsg is returned when the user cancels.

type PathInputResultMsg added in v0.5.0

type PathInputResultMsg struct {
	Action InputAction
	Value  string
}

PathInputResultMsg is returned when the user submits a path.

type PickerAction

type PickerAction int
const (
	PickerNone PickerAction = iota
	PickerExecContainer
	PickerLogContainer
	PickerEnvContainer
	PickerSSMPrefix
	PickerLogPath
	PickerLogSearchTimeRange
	PickerSMFilter
	PickerS3Search
	PickerLambdaSearch
	PickerDynamoTable
	PickerDynamoQuery
	PickerDynamoFilterOp
	PickerSQSQueue
	PickerCWAlarmState
	PickerSetAlarmState
	PickerTofuDir
)

type PickerDeleteMsg

type PickerDeleteMsg struct {
	Action PickerAction
	Index  int
}

type PickerModel

type PickerModel struct {
	Active bool
	Action PickerAction
	Title  string
	Items  []string

	Deletable int // number of items from the start that are deletable (saved entries)
	// contains filtered or unexported fields
}

func NewPicker

func NewPicker(action PickerAction, title string, items []string) PickerModel

func NewPickerWithDelete

func NewPickerWithDelete(action PickerAction, title string, items []string, deletableCount int) PickerModel

func (PickerModel) Update

func (m PickerModel) Update(msg tea.Msg) (PickerModel, tea.Cmd)

func (PickerModel) View

func (m PickerModel) View() string

type PickerResultMsg

type PickerResultMsg struct {
	Action   PickerAction
	Index    int
	Value    string
	Canceled bool
}

Directories

Path Synopsis
Package components provides reusable UI components like the auto-sizing grid table.
Package components provides reusable UI components like the auto-sizing grid table.
Package theme defines ANSI-adaptive colors and lipgloss styles for the TUI.
Package theme defines ANSI-adaptive colors and lipgloss styles for the TUI.
Package views implements the individual bubbletea view models for each screen.
Package views implements the individual bubbletea view models for each screen.

Jump to

Keyboard shortcuts

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