fix: bind KANDEV_AGENT_STANDALONE_PORT env var to config (#61)

This commit is contained in:
João Salavisa
2026-01-20 22:29:05 +00:00
committed by GitHub
parent fafd571728
commit 2fbc229eaf
@@ -193,6 +193,12 @@ func LoadWithPath(configPath string) (*Config, error) {
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.AutomaticEnv()
// Explicit bindings for snake_case env vars (camelCase config keys)
// AutomaticEnv does not handle camelCase to SNAKE_CASE conversion,
// so we explicitly bind keys where env var naming differs from config key naming.
_ = v.BindEnv("agent.standalonePort", "KANDEV_AGENT_STANDALONE_PORT")
_ = v.BindEnv("agent.standaloneHost", "KANDEV_AGENT_STANDALONE_HOST")
// Configure config file
v.SetConfigName("config")
v.SetConfigType("yaml")