Documentation
¶
Index ¶
- Constants
- func InitTheme(cfg *config.Config)
- func ParseSSHString(input string) *config.Connection
- func Run(cfg *config.Config, version string) error
- type ExportItem
- type ExportModel
- func (m ExportModel) Cancelled() bool
- func (m ExportModel) Confirmed() bool
- func (m ExportModel) HasItems() bool
- func (m ExportModel) Init() tea.Cmd
- func (m ExportModel) OutputPath() string
- func (m ExportModel) SelectedConnections() []config.Connection
- func (m ExportModel) Update(msg tea.Msg) (ExportModel, tea.Cmd)
- func (m ExportModel) View() string
- type FormModel
- func (m FormModel) Cancelled() bool
- func (m FormModel) GetConnection() (*config.Connection, error)
- func (m FormModel) Init() tea.Cmd
- func (m FormModel) IsEditing() bool
- func (m FormModel) OriginalID() string
- func (m FormModel) Submitted() bool
- func (m FormModel) Update(msg tea.Msg) (FormModel, tea.Cmd)
- func (m FormModel) View() string
- type HelpModel
- type ImportItem
- type ImportModel
- func (m ImportModel) Cancelled() bool
- func (m ImportModel) Confirmed() bool
- func (m ImportModel) Error() error
- func (m ImportModel) HasItems() bool
- func (m ImportModel) Init() tea.Cmd
- func (m ImportModel) SelectedConnections() []config.Connection
- func (m ImportModel) Update(msg tea.Msg) (ImportModel, tea.Cmd)
- func (m ImportModel) View() string
- type Model
- type Preset
- type Theme
- type ThemePickerModel
- func (m ThemePickerModel) Cancelled() bool
- func (m ThemePickerModel) Confirmed() bool
- func (m ThemePickerModel) Init() tea.Cmd
- func (m ThemePickerModel) Original() Theme
- func (m ThemePickerModel) SelectedPreset() string
- func (m ThemePickerModel) Update(msg tea.Msg) (ThemePickerModel, tea.Cmd)
- func (m ThemePickerModel) View() string
Constants ¶
const ( DefaultDarkPresetName = "default-dark" DefaultLightPresetName = "default-light" )
DefaultDarkPresetName / DefaultLightPresetName back the implicit default applied when theme_preset is not set; the choice between them is made by looking at the terminal background.
Variables ¶
This section is empty.
Functions ¶
func InitTheme ¶ added in v1.6.0
InitTheme picks a palette based on the configured preset and any user overrides. Precedence (low to high):
- Selected preset's palette
- cfg.Theme (shared overrides)
- cfg.ThemeDark or cfg.ThemeLight (only the one matching the preset's light/dark classification)
When theme_preset is unset, the default is auto-selected based on the terminal background (default-dark or default-light). Unknown preset names fall back to default-dark.
func ParseSSHString ¶
func ParseSSHString(input string) *config.Connection
ParseSSHString parses various SSH connection string formats: - user@host - user@host:port - host - host:port - ssh user@host - ssh user@host -p port - ssh -p port user@host - ssh://user@host:port
Types ¶
type ExportItem ¶
type ExportItem struct {
Connection config.Connection
Selected bool
}
ExportItem represents a connection available for export
type ExportModel ¶
type ExportModel struct {
// contains filtered or unexported fields
}
ExportModel handles the export modal
func NewExportModel ¶
func NewExportModel(connections []config.Connection, width, height int) ExportModel
NewExportModel creates a new export model pre-populated with connections. All items start selected.
func (ExportModel) Cancelled ¶
func (m ExportModel) Cancelled() bool
func (ExportModel) Confirmed ¶
func (m ExportModel) Confirmed() bool
func (ExportModel) HasItems ¶
func (m ExportModel) HasItems() bool
HasItems returns true if there are items to export
func (ExportModel) Init ¶
func (m ExportModel) Init() tea.Cmd
func (ExportModel) OutputPath ¶
func (m ExportModel) OutputPath() string
OutputPath returns the user-specified output file path
func (ExportModel) SelectedConnections ¶
func (m ExportModel) SelectedConnections() []config.Connection
SelectedConnections returns the connections that were selected for export
func (ExportModel) Update ¶
func (m ExportModel) Update(msg tea.Msg) (ExportModel, tea.Cmd)
func (ExportModel) View ¶
func (m ExportModel) View() string
type FormModel ¶
type FormModel struct {
// contains filtered or unexported fields
}
func NewFormModel ¶
func NewFormModel(title string, conn *config.Connection) FormModel
func (FormModel) GetConnection ¶
func (m FormModel) GetConnection() (*config.Connection, error)
func (FormModel) OriginalID ¶
type HelpModel ¶
type HelpModel struct {
// contains filtered or unexported fields
}
func NewHelpModel ¶
func NewHelpModel() HelpModel
type ImportItem ¶
type ImportItem struct {
Original string
Connection config.Connection
Renamed bool
Selected bool
}
ImportItem represents a connection to be imported
type ImportModel ¶
type ImportModel struct {
// contains filtered or unexported fields
}
ImportModel handles the SSH config import modal
func NewImportModel ¶
func NewImportModel(existingIDs map[string]bool, sshConfigPath string, hopConfigPath string, width, height int) ImportModel
NewImportModel creates a new import model by parsing SSH config
func (ImportModel) Cancelled ¶
func (m ImportModel) Cancelled() bool
func (ImportModel) Confirmed ¶
func (m ImportModel) Confirmed() bool
func (ImportModel) Error ¶
func (m ImportModel) Error() error
Error returns any error that occurred during parsing
func (ImportModel) HasItems ¶
func (m ImportModel) HasItems() bool
HasItems returns true if there are items to import
func (ImportModel) Init ¶
func (m ImportModel) Init() tea.Cmd
func (ImportModel) SelectedConnections ¶
func (m ImportModel) SelectedConnections() []config.Connection
SelectedConnections returns the connections that were selected for import
func (ImportModel) Update ¶
func (m ImportModel) Update(msg tea.Msg) (ImportModel, tea.Cmd)
func (ImportModel) View ¶
func (m ImportModel) View() string
type Preset ¶ added in v1.7.0
Preset is a named palette. Light and dark variants of the same theme are modelled as separate Presets (e.g. "everforest-dark" and "everforest-light") so users see and pick each one explicitly.
func FindPreset ¶ added in v1.7.0
FindPreset looks up a preset by case-insensitive name. Returns nil if no preset matches.
type Theme ¶ added in v1.6.0
type Theme struct {
Primary lipgloss.Color
Secondary lipgloss.Color
Accent lipgloss.Color
Success lipgloss.Color
Warning lipgloss.Color
Error lipgloss.Color
Muted lipgloss.Color
Selection lipgloss.Color
Foreground lipgloss.Color
}
Theme holds the colors used by the TUI styles. Field names map to the keys accepted under theme / theme_dark / theme_light in config.yaml.
type ThemePickerModel ¶ added in v1.7.0
type ThemePickerModel struct {
// contains filtered or unexported fields
}
ThemePickerModel is the modal view for browsing and selecting bundled presets. Navigation triggers a live preview by mutating currentTheme; the snapshot taken at construction time is restored on cancel or after the caller has consumed the model.
func NewThemePickerModel ¶ added in v1.7.0
func NewThemePickerModel(cfg *config.Config, width, height int) ThemePickerModel
NewThemePickerModel snapshots the active theme and positions the cursor on the currently configured preset (or the auto-selected default if unset).
func (ThemePickerModel) Cancelled ¶ added in v1.7.0
func (m ThemePickerModel) Cancelled() bool
Cancelled reports whether the user pressed esc.
func (ThemePickerModel) Confirmed ¶ added in v1.7.0
func (m ThemePickerModel) Confirmed() bool
Confirmed reports whether the user pressed enter.
func (ThemePickerModel) Init ¶ added in v1.7.0
func (m ThemePickerModel) Init() tea.Cmd
func (ThemePickerModel) Original ¶ added in v1.7.0
func (m ThemePickerModel) Original() Theme
Original returns the theme snapshot taken when the picker opened. Callers use it to restore the theme if persisting the choice fails.
func (ThemePickerModel) SelectedPreset ¶ added in v1.7.0
func (m ThemePickerModel) SelectedPreset() string
SelectedPreset returns the name of the preset under the cursor.
func (ThemePickerModel) Update ¶ added in v1.7.0
func (m ThemePickerModel) Update(msg tea.Msg) (ThemePickerModel, tea.Cmd)
func (ThemePickerModel) View ¶ added in v1.7.0
func (m ThemePickerModel) View() string