Documentation
¶
Overview ¶
Package config loads shim configuration from a .env file and the process environment. Zero external dependencies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEnvPath ¶ added in v1.0.0
func DefaultEnvPath() string
DefaultEnvPath resolves which .env file to load, in order: SHIM_ENV_FILE (explicit override), ./.env (working directory — the dev workflow), then <user-config>/shim/.env (so a background service started by `brew services` finds its config regardless of working directory). Returns "" when none exists; Load then runs from the process environment alone.
<user-config> is $XDG_CONFIG_HOME or ~/.config — i.e. ~/.config/shim/.env.
Types ¶
type Config ¶
type Config struct {
BindAddr string
Port int
Adapter string
UpstreamAPIKey string
UpstreamBaseURL string
UpstreamModel string // optional; catch-all for non-claude-* inputs
// Per-role overrides — empty means "use adapter default for this role."
// Claude Code sends claude-opus*/sonnet*/haiku* model names; the adapter
// maps those to upstream-specific models. These env vars override the
// adapter's per-role default.
UpstreamOpusModel string
UpstreamSonnetModel string
UpstreamHaikuModel string
LogLevel string
LogRedact bool
MaxRequestBytes int64
}
Config holds runtime configuration. Fields are populated from the process environment, optionally pre-seeded from a .env file.