Documentation
¶
Overview ¶
Package config provides configuration management using Viper.
Index ¶
- func ClaudeCodeHooksDir() string
- func CursorConfigDir() string
- func CursorHooksFile() string
- func EnsureDirectories() error
- func ParseValue(value string) interface{}
- type AgentConfig
- type AgentsConfig
- type ColorMode
- type Config
- type DisplayConfig
- type FiltersConfig
- type LoggingConfig
- type LoggingLevel
- type Manager
- type Paths
- type PrivacyConfig
- type StorageConfig
- type StreamTargetConfig
- type StreamsConfig
- type TimezoneMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaudeCodeHooksDir ¶
func ClaudeCodeHooksDir() string
ClaudeCodeHooksDir returns the hooks directory for Claude Code.
func CursorConfigDir ¶
func CursorConfigDir() string
CursorConfigDir returns the config directory for Cursor.
func CursorHooksFile ¶
func CursorHooksFile() string
CursorHooksFile returns the hooks file path for Cursor.
func EnsureDirectories ¶
func EnsureDirectories() error
EnsureDirectories creates all required directories if they don't exist.
func ParseValue ¶
func ParseValue(value string) interface{}
ParseValue parses a string value into an appropriate Go type. It handles booleans and simple arrays.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Enabled bool `mapstructure:"enabled"`
LoggingLevel LoggingLevel `mapstructure:"logging_level,omitempty"`
}
AgentConfig holds settings for a specific agent.
type AgentsConfig ¶
type AgentsConfig struct {
ClaudeCode AgentConfig `mapstructure:"claude-code"`
Cursor AgentConfig `mapstructure:"cursor"`
Gemini AgentConfig `mapstructure:"gemini"`
OpenCode AgentConfig `mapstructure:"opencode"`
OpenClaw AgentConfig `mapstructure:"openclaw"`
Windsurf AgentConfig `mapstructure:"windsurf"`
PiAgent AgentConfig `mapstructure:"pi-agent"`
Codex AgentConfig `mapstructure:"codex"`
}
AgentsConfig holds per-agent settings.
type Config ¶
type Config struct {
Logging LoggingConfig `mapstructure:"logging"`
Storage StorageConfig `mapstructure:"storage"`
Privacy PrivacyConfig `mapstructure:"privacy"`
Filters FiltersConfig `mapstructure:"filters"`
Agents AgentsConfig `mapstructure:"agents"`
Display DisplayConfig `mapstructure:"display"`
Streams StreamsConfig `mapstructure:"streams"`
}
Config holds all configuration values.
func (*Config) GetAgentLoggingLevel ¶
func (c *Config) GetAgentLoggingLevel(agentName string) LoggingLevel
GetAgentLoggingLevel returns the logging level for a specific agent. Falls back to global level if not set.
func (*Config) GetDatabasePath ¶
GetDatabasePath returns the resolved database path from config or default.
func (*Config) IsAgentEnabled ¶
IsAgentEnabled returns true if the given agent is enabled.
func (*Config) ShouldUseColors ¶
ShouldUseColors returns true if colors should be used based on config and terminal.
type DisplayConfig ¶
type DisplayConfig struct {
Colors ColorMode `mapstructure:"colors"`
Timezone TimezoneMode `mapstructure:"timezone"`
}
DisplayConfig holds display-related settings.
type FiltersConfig ¶
type FiltersConfig struct {
Enabled bool `mapstructure:"enabled"`
}
FiltersConfig holds content filter settings.
type LoggingConfig ¶
type LoggingConfig struct {
Level LoggingLevel `mapstructure:"level"`
StdoutMaxChars int `mapstructure:"stdout_max_chars"`
StderrMaxChars int `mapstructure:"stderr_max_chars"`
ContextMaxChars int `mapstructure:"context_max_chars"`
ContentHash bool `mapstructure:"content_hash"`
}
LoggingConfig holds logging-related settings.
type LoggingLevel ¶
type LoggingLevel string
LoggingLevel represents the verbosity level for logging. This is for agent event logging only. Not for our own internal logging.
const ( // LoggingMinimal logs action type, file path, timestamp, result only. LoggingMinimal LoggingLevel = "minimal" // LoggingStandard adds diff stats, command exit codes, truncated output. LoggingStandard LoggingLevel = "standard" // LoggingFull adds raw events, conversation context, full command output, file diffs. LoggingFull LoggingLevel = "full" )
func (LoggingLevel) IsAtLeast ¶
func (l LoggingLevel) IsAtLeast(other LoggingLevel) bool
IsAtLeast returns true if this logging level is at least as verbose as other.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides a high-level API for configuration management. It encapsulates viper and handles defaults, file persistence, and validation.
func NewManager ¶
NewManager creates a new configuration manager. It initializes with defaults and reads the config file if it exists.
func (*Manager) AllSettings ¶
AllSettings returns all configuration values as a map. This includes defaults merged with any file-based overrides.
func (*Manager) ConfigPath ¶
ConfigPath returns the path to the configuration file.
type Paths ¶
type Paths struct {
ConfigFile string
ConfigDir string
DataDir string
DatabaseFile string
CacheDir string
BackupsDir string
}
Paths holds resolved filesystem paths.
func ResolvePaths ¶
func ResolvePaths() *Paths
ResolvePaths returns the resolved filesystem paths for the current platform.
type PrivacyConfig ¶
type PrivacyConfig struct {
SensitivePaths []string `mapstructure:"sensitive_paths"`
RedactPatterns []string `mapstructure:"redact_patterns"`
}
PrivacyConfig holds privacy-related settings.
type StorageConfig ¶
type StorageConfig struct {
Path string `mapstructure:"path"`
RetentionDays int `mapstructure:"retention_days"`
}
StorageConfig holds storage-related settings.
type StreamTargetConfig ¶
type StreamTargetConfig struct {
Name string `mapstructure:"name"`
Type string `mapstructure:"type"`
Enabled bool `mapstructure:"enabled"`
Config map[string]any `mapstructure:"config"`
}
StreamTargetConfig holds settings for a single stream target.
type StreamsConfig ¶
type StreamsConfig struct {
Targets []StreamTargetConfig `mapstructure:"targets"`
}
StreamsConfig holds stream target settings.
type TimezoneMode ¶
type TimezoneMode string
TimezoneMode represents the timezone display mode.
const ( // TimezoneLocal uses the local timezone. TimezoneLocal TimezoneMode = "local" // TimezoneUTC uses UTC. TimezoneUTC TimezoneMode = "utc" )