Skip to content

Configuration

erode is configured through environment variables. There are no configuration files.

For GitHub Actions-specific inputs (model-repo, fail-on-violations, etc.), see GitHub Actions.

VariableDescriptionDefault
AI_PROVIDERAI provider to use (gemini, openai, or anthropic)gemini
GEMINI_API_KEYGoogle Gemini API key
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key (experimental)
VariableDescriptionDefault
MODEL_FORMATArchitecture model formatlikec4
LIKEC4_EXCLUDE_PATHSComma-separated paths to exclude from model loading
LIKEC4_EXCLUDE_TAGSComma-separated tags to exclude from model loading
VariableDescriptionDefault
MAX_FILES_PER_DIFFMaximum number of files to include in the diff50
MAX_LINES_PER_DIFFMaximum number of lines to include in the diff5000
MAX_CONTEXT_CHARSMaximum characters of architectural context10000

Large diffs are truncated 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
GEMINI_FAST_MODELGemini model for Stages 1–2 (extraction)
GEMINI_ADVANCED_MODELGemini model for Stages 3–4 (analysis)
OPENAI_FAST_MODELOpenAI model for Stages 1–2 (extraction)
OPENAI_ADVANCED_MODELOpenAI model for Stages 3–4 (analysis)
ANTHROPIC_FAST_MODELAnthropic model for Stages 1–2 (extraction)
ANTHROPIC_ADVANCED_MODELAnthropic model for Stages 3–4 (analysis)

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

VariableDescriptionDefault
GITHUB_TOKENGitHub token for API access
GITHUB_TIMEOUTRequest timeout for GitHub API (ms)30000
MODEL_REPO_PR_TOKENSeparate token for the model repositoryUses GITHUB_TOKEN

GITHUB_TOKEN is used to read the source PR and post analysis comments. MODEL_REPO_PR_TOKEN is used to create model update PRs (branches, commits, pull requests) on the model repository and falls back to GITHUB_TOKEN when not set.

Same repository — source code and architecture model live in one repo, so a single token covers everything:

FeaturePermissions
Read PR and diffContents: Read, Pull requests: Read
Post analysis commentsIssues: Read and write
Create model update PR (--open-pr)Contents: Read and write, Pull requests: Read and write

External model repository — source and model are in separate repos, each with its own token:

TokenRepositoryPermissions
GITHUB_TOKENSource repoContents: Read, Pull requests: Read, Issues: Read and write
MODEL_REPO_PR_TOKENModel repoContents: Read and write, Pull requests: Read and write

Select these Repository permissions when creating a fine-grained personal access token:

  • Contents — Read-only (or Read and write if using --open-pr on that repo)
  • Pull requests — Read-only (or Read and write if using --open-pr on that repo)
  • Issues — Read and write (source repo only)

The repo scope covers all required permissions. If the model repository is public, public_repo is sufficient for MODEL_REPO_PR_TOKEN.

Section titled “GitHub Apps (recommended for organizations)”

GitHub Apps are the recommended token strategy for organizations:

  • Short-lived tokens — automatically generated and rotated on every workflow run, eliminating long-lived secrets
  • Repository-scoped — access is limited to specific repositories, not broad user-level access
  • Not tied to user accounts — tokens keep working when people leave the organization or change roles
  • Centralized permissions — managed through the App’s installation settings, not individual developer tokens

Use the same Repository permissions as fine-grained PATs above. See GitHub App Token for a complete workflow example.

VariableDescriptionDefault
GITLAB_TOKENGitLab token with api scope
GITLAB_BASE_URLGitLab instance URLhttps://gitlab.com

GITLAB_TOKEN is used for all operations on the source project — reading MR diffs, posting notes, and (with --open-pr) creating branches, commits, and merge requests. The api scope is required; read_api is not sufficient.

For external model projects, the CI entrypoint accepts LIKEC4_MODEL_REPO_TOKEN (see GitLab CI).

TypeScopeMinimum role
Personal Access Tokenapi
Project Access TokenapiDeveloper
Group Access TokenapiDeveloper
VariableDescriptionDefault
BITBUCKET_TOKENBitbucket app password or token
BITBUCKET_BASE_URLBitbucket API base URLhttps://api.bitbucket.org/2.0

BITBUCKET_TOKEN handles all operations — there is no separate model-repo token. If the token contains : (e.g. username:app_password), erode uses HTTP Basic auth; otherwise it uses Bearer auth.

FeatureApp password scopes
Read PRs and diffsRepositories: Read
Post PR commentsPull requests: Write
Create model update PR (--open-pr)Repositories: Write, Pull requests: Write

Minimum scopes (no --open-pr): Repositories: Read + Pull requests: Write. Full scopes (with --open-pr): Repositories: Write + Pull requests: Write.

Repository access tokens and workspace access tokens use the same permission categories but authenticate with Bearer auth.

VariableDescriptionDefault
GEMINI_TIMEOUTRequest timeout for Gemini API calls (ms)60000
OPENAI_TIMEOUTRequest timeout for OpenAI API calls (ms)60000
ANTHROPIC_TIMEOUTRequest timeout for Anthropic API calls (ms)60000
GITHUB_TIMEOUTRequest timeout for GitHub API calls (ms)30000
VariableDescriptionDefault
DEBUG_MODEEnable debug outputfalse
VERBOSEEnable verbose loggingfalse