Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureCacheDir ¶
func EnsureCacheDir() error
EnsureCacheDir creates the cache directory if it doesn't exist
func EnsureConfigDir ¶
func EnsureConfigDir() error
EnsureConfigDir creates the configuration directory if it doesn't exist
func EnsureLogsDir ¶
func EnsureLogsDir() error
EnsureLogsDir creates the logs directory if it doesn't exist
func EnsureTemplatesDir ¶
func EnsureTemplatesDir() error
EnsureTemplatesDir creates the templates directory if it doesn't exist
func GetConfigDir ¶
func GetConfigDir() string
GetConfigDir returns the configuration directory path
func GetTemplatesDir ¶
func GetTemplatesDir() string
GetTemplatesDir returns the templates cache directory path
Types ¶
type UserConfig ¶
type UserConfig struct {
APIEndpoint string `json:"api_endpoint"`
MCPServerEndpoint string `json:"mcp_server_endpoint"`
DefaultAITool string `json:"default_ai_tool"`
LogLevel string `json:"log_level"`
LastUpdateCheck time.Time `json:"last_update_check"`
UpdateCheckEnabled bool `json:"update_check_enabled"`
TelemetryEnabled bool `json:"telemetry_enabled"`
ConfigVersion string `json:"config_version"`
// Basic Auth credentials (not persisted to disk, loaded from env vars only)
BasicAuthUsername string `json:"-"`
BasicAuthPassword string `json:"-"`
}
UserConfig represents CLI configuration
func DefaultConfig ¶
func DefaultConfig() *UserConfig
DefaultConfig returns the default configuration
func Load ¶
func Load() (*UserConfig, error)
Load loads the configuration from disk, or returns default if not found
func (*UserConfig) GetAPIEndpoint ¶
func (c *UserConfig) GetAPIEndpoint() string
GetAPIEndpoint returns the API endpoint with version path
func (*UserConfig) GetTemplateEndpoint ¶
func (c *UserConfig) GetTemplateEndpoint() string
GetTemplateEndpoint returns the full template API endpoint
func (*UserConfig) HasBasicAuth ¶
func (c *UserConfig) HasBasicAuth() bool
HasBasicAuth checks if Basic Auth credentials are configured
func (*UserConfig) IsStaging ¶
func (c *UserConfig) IsStaging() bool
IsStaging checks if the current environment is staging
func (*UserConfig) Save ¶
func (c *UserConfig) Save() error
Save saves the configuration to disk with atomic write
func (*UserConfig) Validate ¶
func (c *UserConfig) Validate() error
Validate validates the configuration