Documentation
¶
Index ¶
- Constants
- Variables
- func GetDefaultConfig() *domain.Config
- func NewCleanCommand() *cobra.Command
- func NewConfigCommand() *cobra.Command
- func NewConfigEditCommand() *cobra.Command
- func NewConfigResetCommand() *cobra.Command
- func NewConfigShowCommand() *cobra.Command
- func NewConfigValidateCommand() *cobra.Command
- func NewGitHistoryCommand() *cobra.Command
- func NewInitCommand() *cobra.Command
- func NewProfileCommand() *cobra.Command
- func NewProfileCreateCommand() *cobra.Command
- func NewProfileDeleteCommand() *cobra.Command
- func NewProfileListCommand() *cobra.Command
- func NewProfileShowCommand() *cobra.Command
- func NewRootCmd() *cobra.Command
- func NewScanCommand() *cobra.Command
- func PrintProfileSummaries(profiles any, format string)
- type CleanerAvailability
- type CleanerConfig
- type CleanerType
- type ScanDisplay
- type ScanResult
Constants ¶
const ( // DiskUsageBarWidth is the width of the disk usage bar in characters. DiskUsageBarWidth = 15 // BytesThresholdGB is the threshold for displaying GB freed message. BytesThresholdGB = 1_000_000_000 // BytesThresholdMB is the threshold for displaying MB freed message. BytesThresholdMB = 100_000_000 )
const ( ProfileFormatText = "text" ProfileFormatJSON = "json" ProfileFormatEmoji = "emoji" )
Variables ¶
var ( ErrNoCleanersAvailable = errors.New("no cleaners available on this system") ErrNoConfigPathProvided = errors.New("no config path provided") )
Sentinel errors for clean command.
var ( ErrProfileNotFound = errors.New("profile not found") ErrProfileNoCleaners = errors.New("profile has no available cleaners") )
Sentinel errors for clean_select.
var ( ErrUnknownCleanerType = errors.New("unknown cleaner type") ErrNixNotAvailable = errors.New("nix not available on this system") ErrGoProcessesRunning = errors.New("other Go processes detected") )
Sentinel errors for cleaner_implementations.
var ( ErrNoGitRepositoriesFound = errors.New("no git repositories found") ErrGitNotAvailable = errors.New("not a git repository or git not available") ErrSafetyChecksFailed = errors.New("safety checks failed") ErrNotAGitRepository = errors.New("not a git repository") )
Sentinel errors for git history operations.
var ( TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(lipgloss.Color("86")). Padding(1, 0) WarningStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("214")). Padding(0, 1) InfoStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("117")). Padding(0, 1) SuccessStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("82")). Padding(0, 1) ErrorStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("196")). Padding(0, 1) HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(lipgloss.Color("81")). Padding(0, 1) MutedStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("241")). Padding(0, 1) )
Functions ¶
func GetDefaultConfig ¶
GetDefaultConfig returns the default configuration. This is a wrapper around config.GetDefaultConfig for use in commands.
func NewCleanCommand ¶
NewCleanCommand creates a multi-cleaner command with TUI.
func NewConfigCommand ¶
NewConfigCommand creates a configuration management command.
func NewConfigEditCommand ¶
NewConfigEditCommand creates a command to edit the configuration.
func NewConfigResetCommand ¶
NewConfigResetCommand creates a command to reset the configuration.
func NewConfigShowCommand ¶
NewConfigShowCommand creates a command to show the configuration.
func NewConfigValidateCommand ¶
NewConfigValidateCommand creates a command to validate the configuration.
func NewGitHistoryCommand ¶
NewGitHistoryCommand creates the git-history subcommand.
func NewInitCommand ¶
NewInitCommand creates an interactive setup wizard command.
func NewProfileCommand ¶
NewProfileCommand creates a profile management command.
func NewProfileCreateCommand ¶
NewProfileCreateCommand creates a command to create a new profile.
func NewProfileDeleteCommand ¶
NewProfileDeleteCommand creates a command to delete a profile.
func NewProfileListCommand ¶
NewProfileListCommand creates a command to list all profiles.
func NewProfileShowCommand ¶
NewProfileShowCommand creates a command to show profile details.
func NewScanCommand ¶
NewScanCommand creates a command that scans for cleanable items.
func PrintProfileSummaries ¶
Types ¶
type CleanerAvailability ¶
type CleanerAvailability string
CleanerAvailability represents the availability status of a cleaner.
const ( CleanerAvailabilityAvailable CleanerAvailability = "available" )
type CleanerConfig ¶
type CleanerConfig struct {
Type CleanerType
Name string
Description string
Icon string
Available CleanerAvailability
}
CleanerConfig holds configuration for each cleaner type.
func GetCleanerConfigs ¶
func GetCleanerConfigs(ctx context.Context) []CleanerConfig
GetCleanerConfigs returns all cleaner configurations with availability status. Uses the CleanerRegistry for dynamic discovery and availability checking. Returns an empty slice if the registry cannot be created.
type CleanerType ¶
type CleanerType string
CleanerType represents available cleaner types for TUI selection.
const ( CleanerTypeNix CleanerType = "nix" CleanerTypeHomebrew CleanerType = "homebrew" CleanerTypeTempFiles CleanerType = "tempfiles" CleanerTypeNodePackages CleanerType = "node" CleanerTypeGoPackages CleanerType = "go" CleanerTypeCargoPackages CleanerType = "cargo" CleanerTypeBuildCache CleanerType = "buildcache" CleanerTypeDocker CleanerType = "docker" CleanerTypeSystemCache CleanerType = "systemcache" CleanerTypeProjectsManagementAutomation CleanerType = "projects" CleanerTypeCompiledBinaries CleanerType = "compiled-binaries" CleanerTypeProjectExecutables CleanerType = "project-executables" CleanerTypeGolangciLintCache CleanerType = "golangci-lint-cache" )
type ScanDisplay ¶
type ScanDisplay struct {
RepoPath string
Files []domain.GitHistoryFile
TotalBytes int64
TotalFiles int
RepoSize int64
Duration time.Duration
}
ScanDisplay holds formatted scan results.
func ScanRepoForDisplay ¶
ScanRepoForDisplay is a helper to get scan results formatted for display.
type ScanResult ¶
type ScanResult struct {
Name string
Available CleanerAvailability
ItemsCount uint
BytesCleanable uint64
Description string
Icon string
}
ScanResult holds the scan result for a cleaner.