Documentation
¶
Overview ¶
Package config provides configuration management for ralphex with embedded defaults.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigDir ¶ added in v0.5.0
func DefaultConfigDir() string
DefaultConfigDir returns the default configuration directory path. returns ~/.config/ralphex/ on all platforms. if os.UserHomeDir() fails, falls back to ./.config/ralphex/ silently - this allows the tool to work even in unusual environments.
Types ¶
type ColorConfig ¶ added in v0.2.0
type ColorConfig struct {
Task string // task execution phase
Review string // review phase
Codex string // codex external review
ClaudeEval string // claude evaluation of codex output
Warn string // warning messages
Error string // error messages
Signal string // completion/failure signals
Timestamp string // timestamp prefix
Info string // informational messages
}
ColorConfig holds RGB values for output colors. each field stores comma-separated RGB values (e.g., "255,0,0" for red).
type Config ¶
type Config struct {
ClaudeCommand string `json:"claude_command"`
ClaudeArgs string `json:"claude_args"`
CodexEnabled bool `json:"codex_enabled"`
CodexEnabledSet bool `json:"-"` // tracks if codex_enabled was explicitly set in config
CodexCommand string `json:"codex_command"`
CodexModel string `json:"codex_model"`
CodexReasoningEffort string `json:"codex_reasoning_effort"`
CodexTimeoutMs int `json:"codex_timeout_ms"`
CodexTimeoutMsSet bool `json:"-"` // tracks if codex_timeout_ms was explicitly set in config
CodexSandbox string `json:"codex_sandbox"`
IterationDelayMs int `json:"iteration_delay_ms"`
IterationDelayMsSet bool `json:"-"` // tracks if iteration_delay_ms was explicitly set in config
TaskRetryCount int `json:"task_retry_count"`
TaskRetryCountSet bool `json:"-"` // tracks if task_retry_count was explicitly set in config
PlansDir string `json:"plans_dir"`
WatchDirs []string `json:"watch_dirs"` // directories to watch for progress files
// output colors (RGB values as comma-separated strings)
Colors ColorConfig `json:"-"`
// prompts (loaded separately from files)
TaskPrompt string `json:"-"`
ReviewFirstPrompt string `json:"-"`
ReviewSecondPrompt string `json:"-"`
CodexPrompt string `json:"-"`
MakePlanPrompt string `json:"-"`
// custom agents (loaded separately from files)
CustomAgents []CustomAgent `json:"-"`
// contains filtered or unexported fields
}
Config holds all configuration settings for ralphex. Fields ending in *Set track whether that field was explicitly set in config. This allows distinguishing explicit false/0 from "not set", enabling proper merge behavior where local config can override global config with zero values.
*Set fields:
- CodexEnabledSet: tracks if codex_enabled was explicitly set
- CodexTimeoutMsSet: tracks if codex_timeout_ms was explicitly set
- IterationDelayMsSet: tracks if iteration_delay_ms was explicitly set
- TaskRetryCountSet: tracks if task_retry_count was explicitly set
func Load ¶
Load loads all configuration from the specified directory. If configDir is empty, uses the default location (~/.config/ralphex/). It also auto-detects .ralphex/ in the current working directory for local overrides. It installs defaults if needed, parses config file, loads prompts and agents.
type CustomAgent ¶
type CustomAgent struct {
Name string // filename without extension
Prompt string // contents of the agent file
}
CustomAgent represents a user-defined review agent.
type Prompts ¶ added in v0.3.0
type Prompts struct {
Task string
ReviewFirst string
ReviewSecond string
Codex string
MakePlan string
}
Prompts holds all loaded prompt templates for different phases of execution. Each prompt can be customized by placing a .txt file in the prompts directory.
type ResetResult ¶ added in v0.5.0
ResetResult holds the result of the reset operation.
type Values ¶ added in v0.3.0
type Values struct {
ClaudeCommand string
ClaudeArgs string
CodexEnabled bool
CodexEnabledSet bool // tracks if codex_enabled was explicitly set
CodexCommand string
CodexModel string
CodexReasoningEffort string
CodexTimeoutMs int
CodexTimeoutMsSet bool // tracks if codex_timeout_ms was explicitly set
CodexSandbox string
IterationDelayMs int
IterationDelayMsSet bool // tracks if iteration_delay_ms was explicitly set
TaskRetryCount int
TaskRetryCountSet bool // tracks if task_retry_count was explicitly set
PlansDir string
WatchDirs []string // directories to watch for progress files
}
Values holds scalar configuration values. Fields ending in *Set (e.g., CodexEnabledSet) track whether that field was explicitly set in config. This allows distinguishing explicit false/0 from "not set", enabling proper merge behavior where local config can override global config with zero values.