Skip to main content

Environment Variables

Dorgu recognizes several environment variables for configuring LLM providers, Kubernetes access, and runtime behavior. Environment variables sit at priority level 5 in the configuration hierarchy — above built-in defaults but below config files and CLI flags.

Variables Reference

Precedence

For API keys, environment variables take precedence over the global config file (~/.config/dorgu/config.yaml). This makes it easy to override keys per-session or in CI pipelines:
For other settings, the standard priority order applies: CLI flags and config files override environment variables.

DORGU_* Prefix

Dorgu uses Viper for configuration management with AutomaticEnv() enabled. This means any configuration key can be overridden via an environment variable with the DORGU_ prefix, using underscores for nested keys:
The DORGU_* prefix variables follow the same naming convention as the config file keys, with dots replaced by underscores and the DORGU_ prefix added. For example, llm.model becomes DORGU_LLM_MODEL.

Usage in CI/CD

Environment variables are the recommended way to configure Dorgu in CI/CD pipelines. Store API keys as secrets and export them before running Dorgu:
When running in CI without a TTY, Dorgu will not prompt for missing API keys. Make sure to set the appropriate environment variable or use the --llm-provider flag to explicitly disable LLM enhancement if no key is available.