Skip to content

Configuration

Erode is configured through environment variables or a .eroderc.json configuration file. For GitHub Actions-specific inputs (model-repo, fail-on-violations, etc.), see GitHub Actions.

Erode resolves configuration in the following order (highest priority wins):

  1. Environment variables (ERODE_*), whether set directly, through CI secrets, or via a .env file
  2. .eroderc.json, project-level settings from the config file
  3. Defaults, built-in defaults for all settings

This means you can commit .eroderc.json with project settings (model format, constraints, adapter config) and provide secrets (API keys, tokens) through environment variables in CI or a local .env file.

Create a .eroderc.json file in your project root or home directory:

{
"$schema": "https://erode.dev/schemas/v0/eroderc.schema.json",
"ai": { "provider": "gemini" }
}

The $schema field enables autocomplete and validation in editors that support JSON Schema. All sections are optional; Erode fills in defaults for anything you omit.

Erode looks for .eroderc.json in the current working directory first, then the home directory. Any ERODE_* environment variables override matching values from the config file.

Environment variable names map to nested JSON keys. For example:

Environment variableJSON path
ERODE_AI_PROVIDERai.provider
ERODE_GEMINI_API_KEYgemini.apiKey
ERODE_MAX_FILES_PER_DIFFconstraints.maxFilesPerDiff
ERODE_MODEL_FORMATadapter.format
ERODE_MODEL_PATHadapter.modelPath
ERODE_MODEL_REPOadapter.modelRepo
ERODE_MODEL_REFadapter.modelRef
VariableDescriptionDefault
ERODE_AI_PROVIDERAI provider to use (gemini, openai, or anthropic)gemini
ERODE_GEMINI_API_KEYGoogle Gemini API key
ERODE_OPENAI_API_KEYOpenAI API key
ERODE_ANTHROPIC_API_KEYAnthropic API key (experimental)
VariableDescriptionDefault
ERODE_MODEL_FORMATArchitecture model format (likec4 or structurizr)likec4
ERODE_MODEL_PATHPath to the architecture model directory
ERODE_MODEL_REPORepository URL or owner/repo containing the model
ERODE_MODEL_REFBranch or tag to clone from the model repositorymain
ERODE_STRUCTURIZR_CLI_PATHPath to the Structurizr CLI WAR file (for .dsl files)
ERODE_LIKEC4_EXCLUDE_PATHSComma-separated paths to exclude from model loading
ERODE_LIKEC4_EXCLUDE_TAGSComma-separated tags to exclude from model loading
VariableDescriptionDefault
ERODE_MAX_FILES_PER_DIFFMaximum number of files to include in the diff50
ERODE_MAX_LINES_PER_DIFFMaximum number of lines to include in the diff5000
ERODE_MAX_CONTEXT_CHARSMaximum characters of architectural context10000

Erode truncates large diffs to stay within these limits. If a PR exceeds them, Erode processes the most relevant files first based on the architecture model context.

Each AI provider uses two model tiers: a fast model for extraction stages and an advanced model for analysis. Override the defaults with these variables:

VariableDescription
ERODE_GEMINI_FAST_MODELGemini model for Stages 1–2 and model updates
ERODE_GEMINI_ADVANCED_MODELGemini model for Stage 3 (analysis)
ERODE_OPENAI_FAST_MODELOpenAI model for Stages 1–2 and model updates
ERODE_OPENAI_ADVANCED_MODELOpenAI model for Stage 3 (analysis)
ERODE_ANTHROPIC_FAST_MODELAnthropic model for Stages 1–2 and model updates
ERODE_ANTHROPIC_ADVANCED_MODELAnthropic model for Stage 3 (analysis)

See AI Providers for default model names and guidance on choosing a provider.

VariableDescriptionDefault
ERODE_GITHUB_TOKENGitHub token for API access
ERODE_GITHUB_BASE_URLGitHub API base URLhttps://api.github.com
ERODE_MODEL_REPO_PR_TOKENSeparate token for the model repositoryUses ERODE_GITHUB_TOKEN
ERODE_GITLAB_TOKENGitLab token with api scope
ERODE_GITLAB_BASE_URLGitLab instance URLhttps://gitlab.com
ERODE_BITBUCKET_TOKENBitbucket app password or token
ERODE_BITBUCKET_BASE_URLBitbucket API base URLhttps://api.bitbucket.org/2.0

See Authentication for required permissions, token types, and platform-specific setup.

VariableDescriptionDefault
ERODE_GEMINI_TIMEOUTRequest timeout for Gemini API calls (ms)60000
ERODE_OPENAI_TIMEOUTRequest timeout for OpenAI API calls (ms)60000
ERODE_ANTHROPIC_TIMEOUTRequest timeout for Anthropic API calls (ms)60000
ERODE_GITHUB_TIMEOUTRequest timeout for GitHub API calls (ms)30000
VariableDescriptionDefault
ERODE_DEBUG_MODEEnable debug outputfalse
ERODE_VERBOSEEnable verbose loggingfalse