config

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigDir is the default configuration directory
	DefaultConfigDir = ".termonaut"

	// ConfigFileName is the configuration file name
	ConfigFileName = "config"

	// ConfigFileType is the configuration file type
	ConfigFileType = "toml"
)

Variables

This section is empty.

Functions

func GetConfigDir

func GetConfigDir() string

GetConfigDir returns the configuration directory path

func GetDataDir

func GetDataDir(config *Config) string

GetDataDir returns the data directory path from config

func Save

func Save(config *Config) error

Save saves configuration to file

Types

type Config

type Config struct {
	// Display and Theme
	DisplayMode      string `mapstructure:"display_mode"`
	Theme            string `mapstructure:"theme"`
	ShowGamification bool   `mapstructure:"show_gamification"`

	// UI Configuration
	UI UIConfig `mapstructure:"ui"`

	// Tracking Behavior
	IdleTimeoutMinutes int  `mapstructure:"idle_timeout_minutes"`
	TrackGitRepos      bool `mapstructure:"track_git_repos"`
	CommandCategories  bool `mapstructure:"command_categories"`

	// GitHub Integration (Optional)
	SyncEnabled          bool   `mapstructure:"sync_enabled"`
	SyncRepo             string `mapstructure:"sync_repo"`
	BadgeUpdateFrequency string `mapstructure:"badge_update_frequency"`

	// Privacy
	OptOutCommands    []string `mapstructure:"opt_out_commands"`
	AnonymousMode     bool     `mapstructure:"anonymous_mode"`
	PrivacySanitizer  bool     `mapstructure:"privacy_sanitizer"`
	SanitizePasswords bool     `mapstructure:"sanitize_passwords"`
	SanitizeURLs      bool     `mapstructure:"sanitize_urls"`
	SanitizeFilePaths bool     `mapstructure:"sanitize_file_paths"`

	// Easter Eggs
	EasterEggsEnabled bool `mapstructure:"easter_eggs_enabled"`

	// Quick Stats on Empty Command
	EmptyCommandStats bool `mapstructure:"empty_command_stats"`

	// Avatar System
	AvatarEnabled      bool   `mapstructure:"avatar_enabled"`
	AvatarStyle        string `mapstructure:"avatar_style"`
	AvatarSize         string `mapstructure:"avatar_size"`
	AvatarColorSupport string `mapstructure:"avatar_color_support"`
	AvatarCacheTTL     string `mapstructure:"avatar_cache_ttl"`

	// Internal
	DataDir  string `mapstructure:"data_dir"`
	LogLevel string `mapstructure:"log_level"`
}

Config represents the application configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration

func Load

func Load() (*Config, error)

Load loads configuration from file or creates default config

type UIConfig added in v0.10.0

type UIConfig struct {
	DefaultMode       string `mapstructure:"default_mode"`       // smart, compact, full, classic, minimal
	Theme             string `mapstructure:"theme"`              // space, cyberpunk, minimal, retro, nature
	ShowAvatar        bool   `mapstructure:"show_avatar"`        // Enable/disable avatar display
	AvatarStyle       string `mapstructure:"avatar_style"`       // pixel-art, bottts, adventurer, avataaars
	CompactLayout     bool   `mapstructure:"compact_layout"`     // Force compact layout
	AnimationsEnabled bool   `mapstructure:"animations_enabled"` // Enable animations
}

UIConfig represents UI-specific configuration

Jump to

Keyboard shortcuts

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