Documentation
¶
Overview ¶
Package config provides configuration management for the noidea tool. It handles loading, saving, and validating user configuration settings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAPIKey ¶ added in v0.2.3
DeleteAPIKey removes the API key from secure storage and config
func ParseFloat ¶
ParseFloat parses a string to a float64 with a default value if parsing fails
func SaveAPIKey ¶ added in v0.2.3
SaveAPIKey saves the API key to secure storage and updates the config file The API key is intentionally NOT saved in the config file for security
func SaveConfig ¶
SaveConfig saves the configuration to the default location
func ValidateConfig ¶
ValidateConfig checks the configuration for errors or inconsistencies Returns a list of issues or an empty slice if the config is valid
Types ¶
type Config ¶
type Config struct {
// LLM contains settings for the AI language model integration
LLM struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"` // "xai", "openai", "deepseek"
APIKey string `json:"api_key"` // API key for the language model provider
Model string `json:"model"` // Model name to use
Temperature float64 `json:"temperature"` // Temperature for AI responses (0.0-1.0)
} `json:"llm"`
// Moai contains settings for the Moai feedback system
Moai struct {
UseLint bool `json:"use_lint"` // Include linting feedback
FacesMode string `json:"faces_mode"` // "random", "sequential", "mood"
Personality string `json:"personality"` // Selected personality
PersonalityFile string `json:"personality_file"` // Custom personality definitions
Feedback bool `json:"feedback"` // Enable AI feedback in post-commit hook
} `json:"moai"`
}
Config represents the application configuration
func LoadConfig ¶
func LoadConfig() Config
LoadConfig loads the configuration from the default location or environment variables If the config file doesn't exist, it returns the default config