Documentation
¶
Index ¶
- Constants
- Variables
- func ConfirmDelete(resourceType, name string) (bool, error)
- func FormatServerDescription(s *Server) string
- func HealthStatusBadge(health HealthStatusType) string
- func RenderHealthIndicator(healthy, checking bool) string
- func RenderKeyHint(key, desc string) string
- func RenderKeyHintsBar(hints []struct{ ... }) string
- func RenderScopeIndicator(scope string) string
- func RenderStatusBadge(installed, enabled bool) string
- func Run() error
- func RunAliasManager() error
- func ServerStatusBadge(status ServerStatusType) string
- type AliasEntry
- type AliasManagerKeyMap
- type AliasManagerModel
- type FilterMode
- type HealthStatusType
- type LogEntry
- type Model
- type ResourceCRUD
- func (r *ResourceCRUD) CreateCommand() (*command.Command, error)
- func (r *ResourceCRUD) CreatePrompt() (*prompt.Prompt, error)
- func (r *ResourceCRUD) CreateRule() (*rule.Rule, error)
- func (r *ResourceCRUD) CreateServer() (*mcp.Server, error)
- func (r *ResourceCRUD) CreateSkill() (*skill.Skill, error)
- func (r *ResourceCRUD) DeleteCommand(cmd *command.Command) error
- func (r *ResourceCRUD) DeletePrompt(p *prompt.Prompt) error
- func (r *ResourceCRUD) DeleteRule(rl *rule.Rule) error
- func (r *ResourceCRUD) DeleteSkill(s *skill.Skill) error
- func (r *ResourceCRUD) EditCommand(cmd *command.Command) error
- func (r *ResourceCRUD) EditPrompt(p *prompt.Prompt) error
- func (r *ResourceCRUD) EditRule(rl *rule.Rule) error
- func (r *ResourceCRUD) EditSkill(s *skill.Skill) error
- type ResourceTab
- type Server
- type ServerStatusType
Constants ¶
const ( StatusInstalled = "●" StatusAvailable = "○" StatusDisabled = "◌" )
Status badge symbols
const ( HealthHealthy = "✓" HealthUnhealthy = "✗" HealthUnknown = "?" HealthChecking = "◐" // Can be animated with spinner )
Health indicator symbols
const ( ScopeLocalIndicator = "[L]" ScopeGlobalIndicator = "[G]" )
Scope indicator symbols
Variables ¶
var ( // Main application container style AppStyle = lipgloss.NewStyle(). Background(colorBg). Foreground(colorFg) // Header style for the top bar HeaderStyle = lipgloss.NewStyle(). Background(colorBg). Foreground(colorFg). Bold(true). Padding(0, 1) // Title style within header HeaderTitleStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true) // Subtitle/version style HeaderSubtitleStyle = lipgloss.NewStyle(). Foreground(colorFgMuted) )
App-level styles
var ( // Installed status badge (●) - teal/green StatusInstalledStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true) // Available status badge (○) - muted StatusAvailableStyle = lipgloss.NewStyle(). Foreground(colorFgMuted) // Disabled status badge (◌) - subtle/dim StatusDisabledStyle = lipgloss.NewStyle(). Foreground(colorFgSubtle) )
Status badge styles
var ( // Healthy indicator (✓) - teal/green HealthHealthyStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true) // Unhealthy indicator (✗) - pink/error HealthUnhealthyStyle = lipgloss.NewStyle(). Foreground(colorPink). Bold(true) // Unknown indicator (?) - yellow/warning HealthUnknownStyle = lipgloss.NewStyle(). Foreground(colorYellow) // Checking indicator (spinner) - cyan HealthCheckingStyle = lipgloss.NewStyle(). Foreground(colorCyan) )
Health indicator styles
var ( // Local scope indicator [L] - teal (project-specific) ScopeLocalStyle = lipgloss.NewStyle(). Foreground(colorTeal) // Global scope indicator [G] - muted (user-wide) ScopeGlobalStyle = lipgloss.NewStyle(). Foreground(colorFgMuted) )
Scope indicator styles
var ( // Normal list item ListItemNormalStyle = lipgloss.NewStyle(). Foreground(colorFg). Padding(0, 1) // Selected list item ListItemSelectedStyle = lipgloss.NewStyle(). Foreground(colorCyan). Background(lipgloss.Color("#252836")). Bold(true). Padding(0, 1) // Dimmed/inactive list item ListItemDimmedStyle = lipgloss.NewStyle(). Foreground(colorFgSubtle). Padding(0, 1) // List item name (primary text) ListItemNameStyle = lipgloss.NewStyle(). Foreground(colorFg) // List item name when selected ListItemNameSelectedStyle = lipgloss.NewStyle(). Foreground(colorCyan). Bold(true) // List item description (secondary text) ListItemDescStyle = lipgloss.NewStyle(). Foreground(colorFgMuted) // List item description when selected ListItemDescSelectedStyle = lipgloss.NewStyle(). Foreground(colorBlue) // Cursor/selection indicator ListCursorStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true) )
List item styles
var ( // Log panel container LogPanelStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorFgSubtle). Padding(0, 1) // Log panel title LogPanelTitleStyle = lipgloss.NewStyle(). Foreground(colorBlue). Bold(true). Padding(0, 1) // Log entry styles by level LogEntryInfoStyle = lipgloss.NewStyle(). Foreground(colorFg) LogEntryDebugStyle = lipgloss.NewStyle(). Foreground(colorFgMuted) LogEntryWarnStyle = lipgloss.NewStyle(). Foreground(colorYellow) LogEntryErrorStyle = lipgloss.NewStyle(). Foreground(colorPink) // Log timestamp LogTimestampStyle = lipgloss.NewStyle(). Foreground(colorFgSubtle) // Log source/component LogSourceStyle = lipgloss.NewStyle(). Foreground(colorCyan) )
Log panel styles
var ( // Key hints bar container (bottom bar) KeyHintsBarStyle = lipgloss.NewStyle(). Background(lipgloss.Color("#252836")). Padding(0, 1) // Key binding (e.g., "j/k") KeyStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true) // Key description (e.g., "up/down") KeyDescStyle = lipgloss.NewStyle(). Foreground(colorFgMuted) // Separator between key hints KeyHintSeparatorStyle = lipgloss.NewStyle(). Foreground(colorFgSubtle) )
Key hints bar styles
var ( // Modal backdrop (dimmed background) ModalBackdropStyle = lipgloss.NewStyle(). Background(lipgloss.Color("#1b1e28")). Foreground(colorFgSubtle) // Modal container ModalStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorCyan). Background(colorBg). Padding(1, 2) // Modal title ModalTitleStyle = lipgloss.NewStyle(). Foreground(colorCyan). Bold(true). Align(lipgloss.Center). Padding(0, 0, 1, 0) // Modal body text ModalBodyStyle = lipgloss.NewStyle(). Foreground(colorFg) // Modal button (normal) ModalButtonStyle = lipgloss.NewStyle(). Foreground(colorFgMuted). Border(lipgloss.RoundedBorder()). BorderForeground(colorFgSubtle). Padding(0, 2) // Modal button (focused/selected) ModalButtonActiveStyle = lipgloss.NewStyle(). Foreground(colorBg). Background(colorTeal). Bold(true). Border(lipgloss.RoundedBorder()). BorderForeground(colorTeal). Padding(0, 2) // Modal button (danger/destructive) ModalButtonDangerStyle = lipgloss.NewStyle(). Foreground(colorBg). Background(colorPink). Bold(true). Border(lipgloss.RoundedBorder()). BorderForeground(colorPink). Padding(0, 2) )
Modal/overlay styles
var ( // Tab bar container TabBarStyle = lipgloss.NewStyle(). BorderBottom(true). BorderForeground(colorFgSubtle). Padding(0, 1) // Inactive tab TabStyle = lipgloss.NewStyle(). Foreground(colorFgMuted). Padding(0, 2) // Active tab TabActiveStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true). BorderBottom(true). BorderForeground(colorTeal). Padding(0, 2) )
Tab styles (for switching between views)
var ( // Search input container SearchStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorCyan). Padding(0, 1) // Search prompt (e.g., "/") SearchPromptStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true) // Search input text SearchInputStyle = lipgloss.NewStyle(). Foreground(colorFg) // Search placeholder SearchPlaceholderStyle = lipgloss.NewStyle(). Foreground(colorFgSubtle) // Match highlight in search results SearchMatchStyle = lipgloss.NewStyle(). Foreground(colorYellow). Bold(true) )
Search/filter styles
var ( // Progress bar track ProgressTrackStyle = lipgloss.NewStyle(). Foreground(colorFgSubtle) // Progress bar fill ProgressFillStyle = lipgloss.NewStyle(). Foreground(colorTeal) // Spinner style SpinnerStyle = lipgloss.NewStyle(). Foreground(colorCyan) // Loading text LoadingTextStyle = lipgloss.NewStyle(). Foreground(colorFgMuted). Italic(true) )
Progress/loading styles
var ( // Success message SuccessStyle = lipgloss.NewStyle(). Foreground(colorTeal). Bold(true) // Warning message WarningStyle = lipgloss.NewStyle(). Foreground(colorYellow). Bold(true) // Error message ErrorStyle = lipgloss.NewStyle(). Foreground(colorPink). Bold(true) // Info message InfoStyle = lipgloss.NewStyle(). Foreground(colorCyan) )
Notification/message styles
var ( // Detail pane container DetailPaneStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorFgSubtle). Padding(1, 2) // Detail pane title (server name) DetailTitleStyle = lipgloss.NewStyle(). Foreground(colorCyan). Bold(true) // Detail section header DetailSectionStyle = lipgloss.NewStyle(). Foreground(colorBlue). Bold(true). MarginTop(1) // Detail label (e.g., "Version:", "Author:") DetailLabelStyle = lipgloss.NewStyle(). Foreground(colorFgMuted) // Detail value DetailValueStyle = lipgloss.NewStyle(). Foreground(colorFg) // Detail URL/link DetailLinkStyle = lipgloss.NewStyle(). Foreground(colorCyan). Underline(true) )
Detail pane styles (right panel showing server details)
var FilterModeNames = []string{"All", "Installed", "Available", "Disabled"}
FilterModeNames returns the display names for filter modes
var TabNames = []string{"Servers", "Commands", "Rules", "Skills", "Prompts", "Hooks"}
TabNames returns the display names for tabs
Functions ¶
func ConfirmDelete ¶
ConfirmDelete shows a confirmation dialog for deletion
func FormatServerDescription ¶
FormatServerDescription formats the description line for a server Shows transport type and command/URL information
func HealthStatusBadge ¶
func HealthStatusBadge(health HealthStatusType) string
HealthStatusBadge returns a visual badge for the health status
- HealthStatusUnknown: question mark (?)
- HealthStatusChecking: spinner character (◐)
- HealthStatusHealthy: checkmark (✓)
- HealthStatusUnhealthy: cross (✗)
func RenderHealthIndicator ¶
RenderHealthIndicator returns a styled health indicator
func RenderKeyHint ¶
RenderKeyHint returns a formatted key hint (e.g., "j/k up/down")
func RenderKeyHintsBar ¶
RenderKeyHintsBar renders a complete key hints bar with multiple hints
func RenderScopeIndicator ¶
RenderScopeIndicator returns a styled scope indicator [L] or [G]
func RenderStatusBadge ¶
RenderStatusBadge returns a styled status badge
func ServerStatusBadge ¶
func ServerStatusBadge(status ServerStatusType) string
ServerStatusBadge returns a visual badge for the server status
- ServerStatusInstalled: filled circle (●)
- ServerStatusAvailable: empty circle (○)
- ServerStatusDisabled: dotted circle (◌)
Types ¶
type AliasEntry ¶
AliasEntry represents an alias in the list
type AliasManagerKeyMap ¶
type AliasManagerKeyMap struct {
Up key.Binding
Down key.Binding
Add key.Binding
Edit key.Binding
Delete key.Binding
Test key.Binding
Validate key.Binding
Search key.Binding
Escape key.Binding
Enter key.Binding
Help key.Binding
Quit key.Binding
Yes key.Binding
No key.Binding
}
AliasManagerKeyMap defines key bindings
type AliasManagerModel ¶
type AliasManagerModel struct {
// contains filtered or unexported fields
}
AliasManagerModel is the Bubble Tea model for managing bundled aliases
func NewAliasManager ¶
func NewAliasManager() *AliasManagerModel
NewAliasManager creates a new alias manager model
func (*AliasManagerModel) Init ¶
func (m *AliasManagerModel) Init() tea.Cmd
func (*AliasManagerModel) View ¶
func (m *AliasManagerModel) View() string
type FilterMode ¶
type FilterMode int
FilterMode represents the current filter for the server list
const ( FilterAll FilterMode = iota FilterInstalled FilterAvailable FilterDisabled )
type HealthStatusType ¶
type HealthStatusType int
HealthStatusType represents the health check status of an MCP server
const ( HealthStatusUnknown HealthStatusType = iota HealthStatusChecking HealthStatusHealthy HealthStatusUnhealthy )
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea model for the TUI
type ResourceCRUD ¶
type ResourceCRUD struct {
// contains filtered or unexported fields
}
ResourceCRUD handles create, read, update, delete operations for resources
func NewResourceCRUD ¶
func NewResourceCRUD(cfg *config.Config) *ResourceCRUD
NewResourceCRUD creates a new resource CRUD handler
func (*ResourceCRUD) CreateCommand ¶
func (r *ResourceCRUD) CreateCommand() (*command.Command, error)
CreateCommand creates a new command via interactive form
func (*ResourceCRUD) CreatePrompt ¶
func (r *ResourceCRUD) CreatePrompt() (*prompt.Prompt, error)
CreatePrompt creates a new prompt via interactive form
func (*ResourceCRUD) CreateRule ¶
func (r *ResourceCRUD) CreateRule() (*rule.Rule, error)
CreateRule creates a new rule via interactive form
func (*ResourceCRUD) CreateServer ¶
func (r *ResourceCRUD) CreateServer() (*mcp.Server, error)
CreateServer creates a new server via interactive form
func (*ResourceCRUD) CreateSkill ¶
func (r *ResourceCRUD) CreateSkill() (*skill.Skill, error)
CreateSkill creates a new skill via interactive wizard The wizard allows defining the skill and adding multiple commands before saving
func (*ResourceCRUD) DeleteCommand ¶
func (r *ResourceCRUD) DeleteCommand(cmd *command.Command) error
DeleteCommand deletes a command
func (*ResourceCRUD) DeletePrompt ¶
func (r *ResourceCRUD) DeletePrompt(p *prompt.Prompt) error
DeletePrompt deletes a prompt
func (*ResourceCRUD) DeleteRule ¶
func (r *ResourceCRUD) DeleteRule(rl *rule.Rule) error
DeleteRule deletes a rule
func (*ResourceCRUD) DeleteSkill ¶
func (r *ResourceCRUD) DeleteSkill(s *skill.Skill) error
DeleteSkill deletes a skill
func (*ResourceCRUD) EditCommand ¶
func (r *ResourceCRUD) EditCommand(cmd *command.Command) error
EditCommand opens the command in the user's editor
func (*ResourceCRUD) EditPrompt ¶
func (r *ResourceCRUD) EditPrompt(p *prompt.Prompt) error
EditPrompt opens the prompt in the user's editor
type ResourceTab ¶
type ResourceTab int
ResourceTab represents the current tab/resource type being viewed
const ( TabServers ResourceTab = iota TabCommands TabRules TabSkills TabPrompts TabHooks )
type Server ¶
type Server struct {
Name string
Desc string // Description of the server
Status ServerStatusType
Health HealthStatusType
HealthError error
HealthLatency string // e.g., "120ms"
Transport string // stdio, http, sse
Command string // for display
Selected bool // for multi-select
Tools []mcpclient.Tool // Discovered tools
ServerConfig *mcp.Server
AliasConfig *aliases.Alias
}
Server represents a unified server item for the TUI list
func (Server) Description ¶
Description implements list.Item interface Returns transport info and command
func (Server) FilterValue ¶
FilterValue implements list.Item interface Returns the server name for filtering
type ServerStatusType ¶
type ServerStatusType int
ServerStatusType represents the installation status of an MCP server
const ( ServerStatusInstalled ServerStatusType = iota ServerStatusAvailable ServerStatusDisabled )