Documentation
¶
Overview ¶
Package userconfig provides user-level configuration for cagent. This configuration is stored in ~/.config/cagent/config.yaml and contains user preferences like aliases.
Index ¶
Constants ¶
const CurrentVersion = "v1"
CurrentVersion is the current version of the user config format
Variables ¶
This section is empty.
Functions ¶
func ValidateAliasName ¶
ValidateAliasName checks if an alias name is valid. Valid names must: - Not be empty - Start with an alphanumeric character - Contain only alphanumeric characters, hyphens, and underscores - Not contain path separators or special characters
Types ¶
type Alias ¶
type Alias struct {
// Path is the agent file path or OCI reference
Path string `yaml:"path"`
// Yolo enables auto-approve mode for all tool calls
Yolo bool `yaml:"yolo,omitempty"`
// Model overrides the agent's model (format: [agent=]provider/model)
Model string `yaml:"model,omitempty"`
}
Alias represents an alias configuration with optional runtime settings
func (*Alias) HasOptions ¶
HasOptions returns true if the alias has any runtime options set
type Config ¶
type Config struct {
// Version is the config format version
Version string `yaml:"version,omitempty"`
// ModelsGateway is the default models gateway URL
ModelsGateway string `yaml:"models_gateway,omitempty"`
// Aliases maps alias names to alias configurations
Aliases map[string]*Alias `yaml:"aliases,omitempty"`
}
Config represents the user-level cagent configuration
func Load ¶
Load loads the user configuration from the config file. If the config file doesn't exist but a legacy aliases.yaml does, the aliases are migrated to the new config file.
func (*Config) DeleteAlias ¶
DeleteAlias removes an alias. Returns true if the alias existed.