commands

package
v0.0.0-...-bcb4c7e Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Overview

Package commands provides cache management CLI commands

Index

Constants

View Source
const (
	PostgreSQLPort = "5432:5432"
	MySQLPort      = "3306:3306"
	RedisPort      = "6379:6379"
)

Port constants for database containers

View Source
const (
	TableTopLeft     = "┌"
	TableTopRight    = "┐"
	TableBottomLeft  = "└"
	TableBottomRight = "┘"
	TableCross       = "┼"
	TableTeeDown     = "┬"
	TableTeeUp       = "┴"
	TableTeeRight    = "├"
	TableTeeLeft     = "┤"
	TableVertical    = "│"
	TableHorizontal  = "─"
)

Table drawing constants

View Source
const (
	DefaultNameWidth        = 20
	DefaultDescriptionWidth = 40
	DefaultCategoryWidth    = 15
	DefaultMethodWidth      = 12
	DefaultStatusWidth      = 10
	DefaultPlatformWidth    = 15
	MaxNameWidth            = 50
	MaxDescriptionWidth     = 80
	MaxCategoryWidth        = 25
	MaxMethodWidth          = 20
	MaxStatusWidth          = 15
	MaxPlatformWidth        = 30
)

Default column widths

View Source
const (
	StepSystemOverview = iota
	StepPluginInstall  // Install required plugins first
	StepDesktopApps    // Only if desktop detected & non-default apps available
	StepLanguages
	StepDatabases
	StepShell     // Only for compatible systems (Linux/macOS)
	StepTheme     // Theme selection after shell
	StepGitConfig // Full name & email for git configuration
	StepConfirmation
	StepInstalling
	StepComplete
)

setupSteps defines the guided setup process

View Source
const (
	// UI Constants
	WaitActivityInterval = 100 // milliseconds

	// Default selections for automated setup
	DefaultNodeJSIndex     = 0 // Node.js
	DefaultPythonIndex     = 1 // Python
	DefaultPostgreSQLIndex = 0 // PostgreSQL

	// File permissions
	DirectoryPermissions   = 0755
	ExecutablePermissions  = 0755
	RegularFilePermissions = 0644
)

Constants for setup configuration

View Source
const (
	// Plugin operation timeouts
	PluginInstallTimeout    = 5 * time.Minute  // Plugin installation timeout - controls how long we wait for plugin installation to complete
	PluginVerifyTimeout     = 30 * time.Second // Per-plugin verification timeout for security validation (checksum/signature)
	PluginDownloadTimeout   = 2 * time.Minute  // Plugin download timeout for network operations
	NetworkOperationTimeout = 30 * time.Second // General network operation timeout for API calls and downloads

	// Default shell index (zsh) - used when no explicit shell selection is made
	// Corresponds to the index in the shell options array where zsh is the first option
	DefaultShellIndex = 0

	// UI Configuration constants for terminal interface appearance
	ProgressBarWidth = 50  // Width of progress bars in terminal characters (fits in standard 80-column terminals)
	MaxErrorMessages = 100 // Maximum number of error messages to collect to prevent unbounded memory growth during installation failures

	// System resource limits for safe memory management
	MaxPluginsPerPlatform = 20 // Maximum expected plugins per platform, used for slice pre-allocation to optimize performance
)

Setup constants for configuration and timeouts

Variables

View Source
var FallbackThemes = []string{
	"Tokyo Night",
	"Synthwave 84",
}

FallbackThemes provides default themes when configuration loading fails These are the themes available for the 1.0 release and are used when: - Configuration files cannot be loaded - Network issues prevent theme discovery - User is in offline mode during setup

Functions

func AddContextualHelp

func AddContextualHelp(cmd *cobra.Command, context help.HelpContext, specific string)

AddContextualHelp adds contextual help flags to any command

func BuildSecureDockerCommand

func BuildSecureDockerCommand(containerName, image, portMapping, envVar string) (string, error)

BuildSecureDockerCommand constructs a Docker command with proper validation and escaping

func DetectRequiredPlugins

func DetectRequiredPlugins(plat platform.DetectionResult) []string

DetectRequiredPlugins detects which DevEx plugins are needed for the current system

func ExecuteSecureShellChange

func ExecuteSecureShellChange(ctx context.Context, shellPath, username string) error

ExecuteSecureShellChange executes chsh command with proper validation and argument separation

func GetAppVersionForTesting

func GetAppVersionForTesting(ctx context.Context, app *types.AppConfig) string

GetAppVersionForTesting is exported for testing purposes only

func GetCommandHelp

func GetCommandHelp(command string) string

GetCommandHelp returns quick help text for a command

func GetPluginBootstrap

func GetPluginBootstrap() *bootstrap.PluginBootstrap

GetPluginBootstrap returns the plugin bootstrap instance

func LoadCommands

func LoadCommands(repo types.Repository, settings config.CrossPlatformSettings) []*cobra.Command

LoadCommands initializes and returns all registered commands.

func NewAddCmd

func NewAddCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewAddCmd creates a new add command

func NewCacheCmd

func NewCacheCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewCacheCmd creates the cache management command

func NewCompletionCmd

func NewCompletionCmd() *cobra.Command

func NewConfigCmd

func NewConfigCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewConfigCmd creates a new config command

func NewDetectCmd

func NewDetectCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewDetectCmd creates a new detect command for technology stack detection

func NewHelpCmd

func NewHelpCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewHelpCmd creates a new help command

func NewInitCmd

func NewInitCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewInitCmd creates a new init command

func NewInstallCmd

func NewInstallCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

func NewListCmd

func NewListCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewListCmd creates the list command with comprehensive subcommand support

func NewRecoveryCmd

func NewRecoveryCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewRecoveryCmd creates a new recovery command for error recovery assistance

func NewRemoveCmd

func NewRemoveCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewRemoveCmd creates a new remove command

func NewRollbackCmd

func NewRollbackCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

func NewRootCmd

func NewRootCmd(version string, repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

func NewSetupCmd

func NewSetupCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

func NewShellCmd

func NewShellCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewShellCmd creates the shell command

func NewStatusCmd

func NewStatusCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewStatusCmd creates a new status command

func NewSystemCmd

func NewSystemCmd(settings config.CrossPlatformSettings) *cobra.Command

NewSystemCmd creates the system command with plugin redirect

func NewTemplateCmd

func NewTemplateCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewTemplateCmd creates a new template command with versioning support

func NewTemplateCustomCmd

func NewTemplateCustomCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewTemplateCustomCmd creates the template custom command group

func NewUndoCmd

func NewUndoCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

NewUndoCmd creates a new undo command

func NewUninstallCmd

func NewUninstallCmd(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command

func Register

func Register(cmdFunc func(repo types.Repository, settings config.CrossPlatformSettings) *cobra.Command)

Register adds a new command to the registry.

func ValidateDockerConfig

func ValidateDockerConfig(containerName, image, portMapping, envVar string) error

ValidateDockerConfig validates Docker configuration parameters for security

func ValidatePath

func ValidatePath(targetPath, basePath string) error

ValidatePath validates that targetPath is within basePath to prevent directory traversal

func ValidateShellCommand

func ValidateShellCommand(shellPath, username string) error

ValidateShellCommand validates parameters for shell command execution

Types

type AddModel

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

AddModel represents the TUI state for the add command

func NewAddModel

func NewAddModel(settings config.CrossPlatformSettings) *AddModel

NewAddModel creates a new add command TUI model

func (AddModel) Init

func (m AddModel) Init() tea.Cmd

func (AddModel) Update

func (m AddModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (AddModel) View

func (m AddModel) View() string

type AppItem

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

AppItem represents an application item for the list component

func (AppItem) Description

func (i AppItem) Description() string

func (AppItem) FilterValue

func (i AppItem) FilterValue() string

func (AppItem) Title

func (i AppItem) Title() string

type AppItemDelegate

type AppItemDelegate struct{}

AppItemDelegate renders list items

func (AppItemDelegate) Height

func (d AppItemDelegate) Height() int

func (AppItemDelegate) Render

func (d AppItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

func (AppItemDelegate) Spacing

func (d AppItemDelegate) Spacing() int

func (AppItemDelegate) Update

func (d AppItemDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

type ApplicationsConfig

type ApplicationsConfig struct {
	Categories []string `yaml:"categories"`
	Defaults   bool     `yaml:"install_defaults"`
	Custom     []string `yaml:"custom_apps,omitempty"`
}

ApplicationsConfig represents application preferences

type AvailableApp

type AvailableApp struct {
	Name        string
	Description string
	Category    string
	Platform    string
	Method      string
	Recommended bool
}

AvailableApp represents an application available for installation

type BackupEntry

type BackupEntry struct {
	AppName      string    `json:"app_name"`
	BackupPath   string    `json:"backup_path"`
	CreatedAt    time.Time `json:"created_at"`
	PackageInfo  string    `json:"package_info"`
	ConfigFiles  []string  `json:"config_files"`
	DataFiles    []string  `json:"data_files"`
	Dependencies []string  `json:"dependencies"`
	Services     []string  `json:"services"`
}

BackupEntry represents a backup entry

type BackupInfo

type BackupInfo struct {
	Timestamp time.Time `yaml:"timestamp"`
	Apps      []string  `yaml:"apps"`
	FilePath  string    `yaml:"file_path"`
}

BackupInfo contains information about a configuration backup

type BackupManager

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

BackupManager handles backup and restore operations for uninstall operations

func NewBackupManager

func NewBackupManager(repo types.Repository) *BackupManager

NewBackupManager creates a new backup manager instance

func (*BackupManager) CleanupOldBackups

func (bm *BackupManager) CleanupOldBackups(maxAge time.Duration) error

CleanupOldBackups removes backups older than the specified duration

func (*BackupManager) CreateBackup

func (bm *BackupManager) CreateBackup(app *types.AppConfig) (*BackupEntry, error)

CreateBackup creates a backup of an application before uninstalling

func (*BackupManager) ListBackups

func (bm *BackupManager) ListBackups() ([]BackupEntry, error)

ListBackups lists all available backups

func (*BackupManager) RestoreBackup

func (bm *BackupManager) RestoreBackup(backupPath string) error

RestoreBackup restores an application from backup

type BoundedErrorCollector

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

BoundedErrorCollector manages error collection with memory bounds This prevents unbounded memory growth during error collection while preserving important error information

func NewBoundedErrorCollector

func NewBoundedErrorCollector(maxErrors int) *BoundedErrorCollector

NewBoundedErrorCollector creates a new error collector with specified bounds

func (*BoundedErrorCollector) AddError

func (c *BoundedErrorCollector) AddError(err error)

AddError safely adds an error to the collector

func (*BoundedErrorCollector) GetErrors

func (c *BoundedErrorCollector) GetErrors() []error

GetErrors returns a copy of collected errors

func (*BoundedErrorCollector) IsTruncated

func (c *BoundedErrorCollector) IsTruncated() bool

IsTruncated returns whether error collection was truncated

type CategoryInfo

type CategoryInfo struct {
	Category    string
	Description string
	Count       int
	Platforms   []string
}

CategoryInfo represents information about a category and its applications

type ConfigInfo

type ConfigInfo struct {
	Path         string    `yaml:"path"`
	Size         int64     `yaml:"size"`
	ModTime      time.Time `yaml:"modified"`
	Exists       bool      `yaml:"exists"`
	Valid        bool      `yaml:"valid"`
	ErrorMessage string    `yaml:"error,omitempty"`
}

ConfigInfo represents configuration file information

type ConfigSummary

type ConfigSummary struct {
	ConfigDir        string     `yaml:"config_dir"`
	Applications     ConfigInfo `yaml:"applications"`
	Environment      ConfigInfo `yaml:"environment"`
	System           ConfigInfo `yaml:"system"`
	Desktop          ConfigInfo `yaml:"desktop"`
	InitMetadata     ConfigInfo `yaml:"init_metadata"`
	Backups          []string   `yaml:"backups"`
	TotalSize        int64      `yaml:"total_size"`
	LastModified     time.Time  `yaml:"last_modified"`
	ValidationErrors []string   `yaml:"validation_errors,omitempty"`
}

ConfigSummary represents a summary of all configuration files

type ConflictDetector

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

ConflictDetector handles detection of uninstall conflicts

func NewConflictDetector

func NewConflictDetector(repo types.Repository) *ConflictDetector

NewConflictDetector creates a new conflict detector

func (*ConflictDetector) DetectConflicts

func (cd *ConflictDetector) DetectConflicts(apps []types.AppConfig, cascade bool) ([]UninstallConflict, error)

DetectConflicts detects all conflicts for uninstalling the given applications

func (*ConflictDetector) ResolveConflicts

func (cd *ConflictDetector) ResolveConflicts(conflicts []UninstallConflict, options UninstallOptions) ([]UninstallConflict, error)

ResolveConflicts provides automatic resolution for some conflicts

func (*ConflictDetector) SummarizeConflicts

func (cd *ConflictDetector) SummarizeConflicts(conflicts []UninstallConflict) ConflictSummary

SummarizeConflicts creates a summary of detected conflicts

type ConflictSummary

type ConflictSummary struct {
	TotalConflicts int
	CriticalCount  int
	WarningCount   int
	InfoCount      int
	CanProceed     bool
}

ConflictSummary provides a summary of conflicts

type ConflictType

type ConflictType string

ConflictType represents the type of conflict detected

const (
	ConflictTypeDependency      ConflictType = "dependency"
	ConflictTypeFileConflict    ConflictType = "file_conflict"
	ConflictTypeServiceConflict ConflictType = "service_conflict"
	ConflictTypeSystemPackage   ConflictType = "system_package"
	ConflictTypeActiveService   ConflictType = "active_service"
)

type DependencyManager

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

DependencyManager handles dependency analysis and management for uninstall operations

func NewDependencyManager

func NewDependencyManager(repo types.Repository) *DependencyManager

NewDependencyManager creates a new dependency manager instance

func (*DependencyManager) FindOrphans

func (dm *DependencyManager) FindOrphans() ([]string, error)

FindOrphans finds orphaned packages in the system

func (*DependencyManager) GetDependents

func (dm *DependencyManager) GetDependents(packageName string) ([]string, error)

GetDependents returns packages that depend on the given package

func (*DependencyManager) IsSystemPackage

func (dm *DependencyManager) IsSystemPackage(packageName string) bool

IsSystemPackage checks if a package is a critical system package

func (*DependencyManager) RemoveOrphans

func (dm *DependencyManager) RemoveOrphans() error

RemoveOrphans removes all orphaned packages

type DesktopConfig

type DesktopConfig struct {
	Environment string   `yaml:"environment"`
	Themes      []string `yaml:"themes,omitempty"`
	Extensions  []string `yaml:"extensions,omitempty"`
}

DesktopConfig represents desktop environment preferences

type EnvironmentConfig

type EnvironmentConfig struct {
	Languages []string `yaml:"languages"`
	Shell     string   `yaml:"shell"`
	Editor    string   `yaml:"editor"`
}

EnvironmentConfig represents environment preferences

type GitConfiguration

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

GitConfiguration holds Git-specific configuration state

type InitConfig

type InitConfig struct {
	Profile      string             `yaml:"profile"`
	Platform     PlatformConfig     `yaml:"platform"`
	Applications ApplicationsConfig `yaml:"applications"`
	Environment  EnvironmentConfig  `yaml:"environment"`
	System       SystemConfig       `yaml:"system"`
	Desktop      DesktopConfig      `yaml:"desktop,omitempty"`
}

InitConfig represents the configuration created by init command

type InstallCompleteMsg

type InstallCompleteMsg struct{}

type InstallProgressMsg

type InstallProgressMsg struct {
	Status   string
	Progress float64
}

InstallProgressMsg Installation process and progress tracking

type InstallQuitMsg

type InstallQuitMsg struct{}

InstallQuitMsg signals that the setup should exit after installation

type InstallationState

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

InstallationState tracks the current installation progress and errors

type InstalledApp

type InstalledApp struct {
	Name        string
	Description string
	Category    string
	Method      string
	Status      string
}

InstalledApp represents an application that has been installed on the system

type ListCommandOptions

type ListCommandOptions struct {
	Format      string
	Category    string
	Search      string
	Method      string
	Recommended bool
	Interactive bool
	Verbose     bool
}

ListCommandOptions holds all the configuration options for list commands

type PlatformConfig

type PlatformConfig struct {
	OS           string `yaml:"os"`
	Distribution string `yaml:"distribution,omitempty"`
	Version      string `yaml:"version,omitempty"`
	Architecture string `yaml:"architecture"`
	Desktop      string `yaml:"desktop_environment,omitempty"`
}

PlatformConfig represents platform detection results

type PlatformPluginMapping

type PlatformPluginMapping struct {
	OS              string
	Distribution    string
	DesktopEnv      string
	RequiredPlugins []string
}

PlatformPluginMapping defines the mapping between platform characteristics and required plugins

type PluginInstallCompleteMsg

type PluginInstallCompleteMsg struct {
	Errors            []error
	SuccessCount      int
	TotalCount        int
	SuccessfulPlugins []string
}

PluginInstallCompleteMsg indicates plugin installation is complete

type PluginInstallMsg

type PluginInstallMsg struct {
	Status   string
	Progress float64
	Error    error
}

PluginInstallMsg represents a plugin installation progress update

type PluginState

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

PluginState manages plugin installation state

type PluginStatus

type PluginStatus struct {
	Name   string
	Status string // "pending", "downloading", "verifying", "installing", "success", "error"
	Error  string
}

PluginStatus represents the status of a single plugin

type PluginStatusUpdateMsg

type PluginStatusUpdateMsg struct {
	PluginName string
	Status     string // "pending", "downloading", "verifying", "installing", "success", "error"
	Error      string
}

PluginStatusUpdateMsg represents a status update for an individual plugin

type PluginValidationResult

type PluginValidationResult struct {
	PluginName     string
	IsValid        bool
	ChecksumValid  bool
	SignatureValid bool
	Error          error
	ValidationTime time.Duration
}

PluginValidationResult represents the comprehensive result of validating a single plugin. It contains validation status, security verification results, timing metrics, and any errors encountered. This type is used to provide detailed feedback about plugin integrity and security compliance.

type PluginValidator

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

PluginValidator provides enterprise-grade plugin validation with advanced security verification and performance optimizations. It supports parallel processing, early termination strategies, checksum verification, GPG signature validation, and configurable critical plugin handling.

Key features:

  • Parallel processing with configurable worker pools
  • Early termination on critical plugin failures
  • Comprehensive security validation (checksums, signatures)
  • Performance monitoring and timeout handling
  • Configurable critical plugin classification

Validation timeout rationale: 30-second default provides adequate time for network operations (downloading signatures, key verification) while preventing indefinite hangs in CI/CD environments.

func NewPluginValidator

func NewPluginValidator(pluginBootstrap *bootstrap.PluginBootstrap, config PluginValidatorConfig) *PluginValidator

NewPluginValidator creates a new enhanced plugin validator with the specified configuration. It implements intelligent defaults for production use while allowing full customization.

Default behaviors:

  • Concurrency: Limited to min(NumCPU(), 4) for optimal resource utilization
  • Timeout: 30 seconds per plugin (adequate for network operations)
  • Critical plugins: Loaded from config hierarchy or defaults to essential system plugins

The validator automatically optimizes for the target environment, scaling concurrency based on available CPU cores while maintaining reasonable resource limits.

Critical plugin classification: Critical plugins are validated first with potential early termination to provide immediate feedback on essential system components.

func (*PluginValidator) ValidatePlugins

func (v *PluginValidator) ValidatePlugins(ctx context.Context, requiredPlugins []string) *ValidationSummary

ValidatePlugins performs comprehensive plugin validation using a two-phase approach optimized for both security and performance in enterprise environments.

Validation algorithm:

Phase 1: Critical Plugin Validation (Sequential)
  - Validates essential system plugins first for immediate feedback
  - Supports early termination on critical failures (if FailOnCritical=true)
  - Reduces time-to-feedback for core system dependencies

Phase 2: Parallel Validation (Concurrent)
  - Validates remaining plugins using configurable worker pools
  - Optimizes resource utilization while maintaining system stability
  - Provides comprehensive coverage with timeout protection

Security features:

  • Checksum verification for plugin integrity
  • GPG signature validation for authenticity (when configured)
  • Registry trust validation
  • Timeout-based protection against hanging operations

Performance optimizations:

  • O(1) plugin lookup using hash sets
  • Parallel processing with bounded concurrency
  • Early termination strategies
  • Pre-allocated result collections

Context cancellation is respected throughout the validation process, enabling graceful shutdown in CI/CD environments or user-initiated cancellations.

type PluginValidatorConfig

type PluginValidatorConfig struct {
	VerifyChecksums      bool
	VerifySignatures     bool
	Concurrency          int
	FailOnCritical       bool
	CriticalPlugins      []string
	VerificationTimeout  time.Duration
	AllowInsecurePlugins bool
}

PluginValidatorConfig provides comprehensive configuration options for plugin validation behavior. It controls security settings, performance parameters, and operational policies.

Configuration hierarchy (highest to lowest precedence):

  1. Explicit config values passed to NewPluginValidator
  2. Environment variables (DEVEX_CRITICAL_PLUGINS)
  3. Viper configuration files (plugin.critical)
  4. Sensible defaults

Security considerations:

  • VerifyChecksums: Essential for integrity validation
  • VerifySignatures: Provides authenticity verification (requires GPG infrastructure)
  • FailOnCritical: Enables fail-fast behavior for production environments

type ProfileTemplate

type ProfileTemplate struct {
	Name        string
	Description string
	Categories  []string
	Languages   []string
	Tools       []string
}

ProfileTemplate represents a pre-configured profile

type RemoveAppItem

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

RemoveAppItem represents an application item for removal

func (RemoveAppItem) Description

func (i RemoveAppItem) Description() string

func (RemoveAppItem) FilterValue

func (i RemoveAppItem) FilterValue() string

func (RemoveAppItem) Title

func (i RemoveAppItem) Title() string

type RemoveItemDelegate

type RemoveItemDelegate struct{}

RemoveItemDelegate renders list items for removal

func (RemoveItemDelegate) Height

func (d RemoveItemDelegate) Height() int

func (RemoveItemDelegate) Render

func (d RemoveItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

func (RemoveItemDelegate) Spacing

func (d RemoveItemDelegate) Spacing() int

func (RemoveItemDelegate) Update

func (d RemoveItemDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

type RemoveModel

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

RemoveModel represents the TUI state for the remove command

func NewRemoveModel

func NewRemoveModel(settings config.CrossPlatformSettings) *RemoveModel

NewRemoveModel creates a new remove command TUI model

func (RemoveModel) Init

func (m RemoveModel) Init() tea.Cmd

func (RemoveModel) Update

func (m RemoveModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (RemoveModel) View

func (m RemoveModel) View() string

type SetupModel

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

SetupModel represents the state of our guided setup UI This model is organized into focused sub-structures for better maintainability

func (*SetupModel) Init

func (m *SetupModel) Init() tea.Cmd

Init satisfies the tea.Model interface

func (*SetupModel) Update

func (m *SetupModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model state

func (*SetupModel) View

func (m *SetupModel) View() string

View renders the current UI state

type SystemConfig

type SystemConfig struct {
	GitConfig   bool   `yaml:"configure_git"`
	SSHConfig   bool   `yaml:"configure_ssh"`
	GlobalTheme string `yaml:"global_theme,omitempty"`
}

SystemConfig represents system preferences

type SystemInfo

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

SystemInfo contains detected system information and available options

type TableConfig

type TableConfig struct {
	NameWidth        int
	DescriptionWidth int
	CategoryWidth    int
	MethodWidth      int
	StatusWidth      int
}

TableConfig contains configuration for table rendering with dynamic width calculation

func NewAvailableAppTableConfig

func NewAvailableAppTableConfig(apps []AvailableApp) *TableConfig

NewAvailableAppTableConfig creates optimal table configuration for available apps

func NewInstalledAppTableConfig

func NewInstalledAppTableConfig(apps []InstalledApp) *TableConfig

NewInstalledAppTableConfig creates optimal table configuration for installed apps

type TemplateSelectionModel

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

TemplateSelectionModel represents the TUI state for template selection

func NewTemplateSelectionModel

func NewTemplateSelectionModel(templatesManager *templates.TemplateManager) (*TemplateSelectionModel, error)

NewTemplateSelectionModel creates a new template selection model

func (TemplateSelectionModel) Init

func (m TemplateSelectionModel) Init() tea.Cmd

func (TemplateSelectionModel) Update

func (m TemplateSelectionModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (TemplateSelectionModel) View

func (m TemplateSelectionModel) View() string

type UISelections

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

UISelections groups all user selection states for the setup interface

type UninstallConflict

type UninstallConflict struct {
	Type        ConflictType `json:"type"`
	AppName     string       `json:"app_name"`
	ConflictApp string       `json:"conflict_app,omitempty"`
	Description string       `json:"description"`
	Severity    string       `json:"severity"` // "critical", "warning", "info"
	Resolution  string       `json:"resolution"`
}

UninstallConflict represents a conflict that prevents uninstallation

type UninstallHistoryEntry

type UninstallHistoryEntry struct {
	ID                  int       `json:"id"`
	AppName             string    `json:"app_name"`
	AppVersion          string    `json:"app_version"`
	InstallMethod       string    `json:"install_method"`
	UninstallDate       time.Time `json:"uninstall_date"`
	BackupLocation      string    `json:"backup_location"`
	CanRestore          bool      `json:"can_restore"`
	UninstallMethod     string    `json:"uninstall_method"`
	UninstallFlags      string    `json:"uninstall_flags"`
	DependenciesRemoved string    `json:"dependencies_removed"`
	ConfigFilesRemoved  string    `json:"config_files_removed"`
	DataFilesRemoved    string    `json:"data_files_removed"`
	ServicesStopped     string    `json:"services_stopped"`
	PackageInfo         string    `json:"package_info"`
	RollbackScript      string    `json:"rollback_script"`
	Notes               string    `json:"notes"`
}

UninstallHistoryEntry represents an entry in the uninstall history

type UninstallOptions

type UninstallOptions struct {
	Force         bool
	KeepConfig    bool
	KeepData      bool
	RemoveOrphans bool
	Cascade       bool
	Backup        bool
	StopServices  bool
	CleanupSystem bool
}

UninstallOptions represents the options for uninstall operation

type ValidationSummary

type ValidationSummary struct {
	TotalPlugins     int
	ValidPlugins     int
	InvalidPlugins   int
	CriticalFailures int
	Errors           []error
	ValidationTime   time.Duration
	Results          []PluginValidationResult
}

ValidationSummary provides an aggregated view of plugin validation results across multiple plugins. It includes overall statistics, performance metrics, and collected errors for comprehensive reporting. This summary is essential for understanding the health and security posture of the entire plugin ecosystem.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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