Skip to content

Environment Variables

All environment variables are optional and override their corresponding config file values.

Provider Configuration

VariableConfig PathDescription
CARETFORGE_DEFAULT_PROVIDERdefaultProviderDefault provider name

Azure Foundry

VariableConfig PathDescription
CARETFORGE_AZURE_ENDPOINTproviders.azureFoundry.endpointAzure resource URL
CARETFORGE_AZURE_API_KEYproviders.azureFoundry.apiKeyAPI key
CARETFORGE_AZURE_AUTH_MODEproviders.azureFoundry.authModeAuth mode

Azure Agents

VariableConfig PathDescription
CARETFORGE_AGENT_ENDPOINTproviders.azureAgents.endpointAgent project endpoint
CARETFORGE_AGENT_IDproviders.azureAgents.agentIdAgent ID
CARETFORGE_AGENT_API_KEYproviders.azureAgents.apiKeyAPI key (optional)

Other

VariableDescription
LOG_LEVELPino log level (trace, debug, info, warn, error)
XDG_CONFIG_HOMEOverride default config directory on Linux/macOS

Example: CI/CD Setup

bash
# In your CI pipeline
export CARETFORGE_AZURE_ENDPOINT="https://my-resource.services.ai.azure.com"
export CARETFORGE_AZURE_API_KEY="${{ secrets.AZURE_API_KEY }}"

caretforge run "Review this PR" --json --model gpt-4.1

Example: Multiple Environments

bash
# Development
export CARETFORGE_AZURE_ENDPOINT="https://dev-resource.services.ai.azure.com"

# Production
export CARETFORGE_AZURE_ENDPOINT="https://prod-resource.services.ai.azure.com"

Precedence

Remember the override order:

CLI flags  >  Environment variables  >  Config file  >  Defaults

An environment variable always wins over the config file, but a CLI flag always wins over everything.

Released under the MIT License.