Skip to main content

Environment variables

The CLI and runtime read a small set of environment variables. All of them have safe defaults.

Core runtime

VariableDefaultPurpose
DECLARAGENT_CONFIG_DIR$HOME/.declaragentOverrides the per-user config directory. The deploy-generated Dockerfile sets it to /etc/declaragent.
DECLARAGENT_BUILDERunseton enables the conversational builder toolkit (the 15 Declara* tools) in the REPL.
BUILDER_RECORDunset1 wraps the live provider so builder conversations are recorded as regression fixtures.
DECLARAGENT_METRICS_PORT9464 (detached)Prometheus /metrics + control-plane port for declaragent up. On by default in detached mode (-d); foreground runs bind only when this is set. 0 disables.
DECLARAGENT_BIND_ADDRESS127.0.0.1Control-plane listener bind address. Non-loopback binds require auth on all but the safe route subset.
DECLARAGENT_DRAIN_DEADLINE_MS15000Graceful-drain budget on shutdown. 0 disables draining (immediate teardown).
DECLARAGENT_PROVIDER_RATE_LIMIT_RPSper-provider presetOverrides the provider token-bucket rate in up.
DECLARAGENT_PROVIDER_RATE_LIMIT_DISABLEunset1 skips the provider rate-limit wrap in up entirely.
DECLARAGENT_RPC_AUTH_DEFAULTunseton previews the 0.8.0 zero-trust default (rpc.auth.enabled assumed true when rpc-peers.yaml is present).
DECLARAGENT_BASH_ENV_ALLOW / DECLARAGENT_BASH_ENV_DENYunsetComma-separated allow/deny lists for env vars passed through to the bash tool.
DECLARAGENT_CLI_VERSIONbuild versionOverrides the CLI version stamped into up state (ops/test override).
OTEL_EXPORTER_OTLP_ENDPOINTunsetEnables OpenTelemetry span export when set (requires the @opentelemetry/* packages to be installed — see Observability).

Telemetry: there is no telemetry env var. The init wizard asks once and records an opt-out as the sentinel file ~/.declaragent/.telemetry-opt-out. Offline installs: there is no offline env var either — use declaragent init --skip-verify to skip the wizard's provider verification call.

Installer

VariableDefaultPurpose
DECLARAGENT_VERSIONlatestTag to install. curl + npm paths both honor it.
DECLARAGENT_PREFIX$HOME/.localInstall prefix for the curl installer. Binary lands at $PREFIX/bin/declaragent.
DECLARAGENT_BASE_URLGitHub releasesRelease origin override. Used by CI smoke tests to stage a local mirror.
DECLARAGENT_NO_CHECKSUMunsetSkips the SHA-256 verify. Never set this in production.
DECLARAGENT_NO_POSTINSTALLunsetnpm path only. Skips the binary download; the launcher prints a hint.
DECLARAGENT_USE_BINARYunsetnpm launcher only. 1 forces the compiled binary even when Bun + the dist JS are available (debugging / safety valve).
DECLARAGENT_SIZE_BUDGET_MB120Build-only. Used by scripts/build-binary.sh to fail the release if the compiled binary exceeds the budget.

Integration / soak test gates

Per-suite gates for the Docker-Compose-backed integration and soak suites. Not used in normal operation — each suite is skipped unless its gate is set to 1.

VariablePurpose
KAFKA_INTEGRATION / NATS_INTEGRATION / MQTT_INTEGRATION / AMQP_INTEGRATION / SQS_INTEGRATIONBroker transport integration suites.
ELASTIC_INTEGRATION / SPLUNK_INTEGRATION / DATADOG_INTEGRATIONSIEM audit-export integration suites.
FLEET_INTEGRATION / LOAD_INTEGRATION / RPC_AUTH_INTEGRATIONFleet-runtime, load, and RPC-auth (OIDC/OAuth2) suites.
KAFKA_SOAKThe long-running Kafka soak harness (Pillar 3 soak evidence).

Provider API keys

Each provider preset declares a canonical envVar. If set, the CLI picks it up automatically — no need to run declaragent auth login.

ProviderEnv var
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEY
OpenRouterOPENROUTER_API_KEY
GroqGROQ_API_KEY
DeepSeekDEEPSEEK_API_KEY
TogetherTOGETHER_API_KEY
MistralMISTRAL_API_KEY
xAI (Grok)XAI_API_KEY
Ollama (local)OLLAMA_API_KEY (usually empty)
LM Studio (local)LMSTUDIO_API_KEY (usually empty)
llama.cpp (local)LLAMACPP_API_KEY (usually empty)

See Provider matrix for per-provider features.

Cloud / secrets

Inherit from each provider SDK. Listed for completeness:

VariableUsed by
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKENAWS Secrets Manager resolver, SQS source.
KUBERNETES_SERVICE_HOST / KUBERNETES_SERVICE_PORT_HTTPSKubernetes secret resolver (auto-detected when pod-mounted).
WEBHOOK_SECRET / TEST_WEBHOOK_SECRET / TEST_WEBHOOK_TOKENWebhook source HMAC verification.

Adapter-specific credentials (Slack bot tokens, Telegram tokens, etc.) are documented in each channel adapter's README and referenced from channels.yaml via ${env:...}.