Skip to main content

Environment variables

ERun reads a small number of ERUN_* variables, mostly when running inside a runtime pod.

In-pod variables (set by the helm chart)

VariableTypeDefaultPurposeSource
ERUN_REPO_PATHabsolute path/home/erun/git/<repo>Project checkout inside the pod. In-pod erun resolves the project root from it (so erun terraform and the MCP repo-path find the tree); a sourceless runtime env's release tree is symlinked here with no .git, so the host's git-repo walk can't apply.Helm chart (worktreeHostPath template).
ERUN_OUTPUTS_DIRabsolute path/home/erun/.erun/outputsCanonical agent outputs directory: where agents/skills write deliverables that erun outputs lists and downloads. On the home PVC, so it persists across pod restarts.Helm chart (literal on the runtime + MCP containers); created by the image and the entrypoint.
ERUN_REPO_REMOTEbool literal true/falseunset on host; true in podMarks the pod as a runtime pod. Used by IsInRuntimeEnvironment.Helm chart, only when env type is remote-agent or runtime.
ERUN_REPO_URLgit remote URLunset unless mounting sourceGit remote the runtime pod clones into ERUN_REPO_PATH on first boot, for a runtime env that opted into a mutable source worktree. The entrypoint clones only into an empty worktree, so live edits survive restarts.Helm chart, only when EnvConfig.mountsource is set with a repourl.
ERUN_REPO_REFgit ref (release tag)unset unless mounting sourceRef checked out after the clone — the deployed release tag v<version>. Best-effort: an unresolvable ref leaves the clone on its default branch.Helm chart (v + the deployed version).
ERUN_ENV_TYPEenum local-agent/remote-agent/runtime(set in pod)The env's resolved type. The pod entrypoint writes it into the in-pod EnvConfig.type, so in-pod erun resolves the same type the laptop did.Helm chart (the inverse of the worktreeStorage mapping).
ERUN_TENANTstring(required)Tenant name.Deploy plan (the tenant under which the chart runs); not a field on EnvConfig.
ERUN_ENVIRONMENTstring(required)Environment name.EnvConfig.name.
ERUN_KUBERNETES_CONTEXTstringin-clusterAlways in-cluster inside the pod.Helm chart literal.
ERUN_NAMESPACEstring<tenant>-<env>Pod's Kubernetes namespace.Downward API (metadata.namespace).
ERUN_MCP_PORTint (1024–65535)17000MCP server listener.Allocated by the deploy plan from EnvConfig.localportrangestart; passed to the chart via --set mcpPort.
ERUN_SSHD_PORTint (1024–65535)22In-pod SSH server.Hardcoded by the chart at 22 inside the pod. EnvConfig.sshd.localport controls the host-side forward port, not the in-pod port.
ERUN_IDLE_TIMEOUTduration (Go time.ParseDuration grammar)5mSee EnvConfig.idle.timeout.EnvConfig.idle.timeout.
ERUN_IDLE_WORKING_HOURSstring HH:MM-HH:MMunsetWindow during which idle-stop may fire.EnvConfig.idle.workinghours.
ERUN_IDLE_TIMEZONEIANA TZhost TZTZ for WORKING_HOURS.EnvConfig.idle.timezone.
ERUN_IDLE_TRAFFIC_BYTESint6465536Below-threshold quiet bytes.EnvConfig.idle.idletrafficbytes.
ERUN_CLOUD_ENVIRONMENTstringunsetCloud-context alias; presence signals managed cloud.EnvConfig.cloudprovideralias resolution.
ERUN_CLOUD_CONTEXT_NAMEstringunsetCluster id.Cloud-context lookup.
ERUN_CLOUD_PROVIDERenum (aws, gcp, azure, onprem)unsetProvider kind.Cloud-context lookup.
ERUN_CLOUD_PROVIDER_ALIASstringunsetProvider alias (admin-defined).Cloud-context lookup.
ERUN_CLOUD_REGIONstringunsetCloud region (e.g. eu-west-2).Cloud-context lookup.
ERUN_CLOUD_INSTANCE_IDstringunsetProvider-specific instance id (EC2 InstanceId, GCE name, etc.).Cloud-context lookup.
AWS_PROFILEstringunseterun-host on an AWS environment that carries a cloud alias, selecting the profile ERun writes the operator's short-lived credentials into (erun cloud refresh, erun open, the desktop refresher). Absent otherwise.cloudContext.useHostCredentials, set by deploy from EnvConfig.cloudprovideralias.
AWS_REGIONstringunsetDefault AWS region for every SDK and CLI call in the pod, on an AWS environment. Emitted only when a region resolves — an empty AWS_REGION would override the region the pod's own AWS profile carries instead of falling back to it, so "no region resolved" means the variable is absent. Resolution order: managed cloud context → kubeconfig context name → the alias's Identity Center region → the region in an ECR registry host.cloudContext.region, threaded by deploy only when non-empty.
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGIONstringAWS_REGIONRegion for Claude's small/fast helper model. Follows the same omit-when-unresolved rule as AWS_REGION.claude.smallFastModelAWSRegion, defaulting to cloudContext.region.
ERUN_RUNTIME_REGISTRYstringunsetRegistry erun resolves runtime image refs / runtime versions against. When unset the in-pod config omits it and resolution falls back to ghcr.io/sophium.EnvConfig.runtimeregistry via the deploy spec (--set-string runtimeRegistry).
ERUN_CONTAINER_REGISTRIESJSONunsetThe env's marked registry list ([{"registry":"…","roles":["build","deploy"]}]), so in-pod build/push role resolution works on remote/runtime pods whose list lives only on the env config rather than in a repo .erun/config.yaml. When unset the in-pod config omits it.EnvConfig.containerregistries via the deploy spec (--set-json containerRegistries).
ERUN_DISABLE_BUILD_SCRIPTboolfalseDisable build.sh discovery for in-pod (remote-agent) builds. Always written (true and false) when the chart sets it, so erun doctor --sync-config can reconcile a flip; an older chart that does not set it yields false.EnvConfig.disablebuildscript via the deploy spec (--set disableBuildScript).
CLAUDE_CODE_USE_MANTLEboolunsetRoute Claude through Mantle.EnvConfig.claude.usemantle.
CLAUDE_CODE_USE_BEDROCKboolunsetRoute Claude through AWS Bedrock.EnvConfig.claude.usebedrock.
CLAUDE_CODE_MAX_OUTPUT_TOKENSintunsetMax tokens per Claude response.EnvConfig.claude.maxoutputtokens.
ERUN_CLAUDE_AVAILABLE_MODELScomma-separated stringsunsetAllow-list of Claude model identifiers.EnvConfig.claude.models[].
ANTHROPIC_API_KEYstringunsetRead directly by Claude Code. Set only via Kubernetes Secret reference in the runtime chart's values.External Secret.
ANTHROPIC_BASE_URLURLunsetOverride the Claude Code API endpoint.Per-env chart values.

Each EnvConfig.* reference is fully spec'd in Configuration · EnvConfig.

CLI-side variables

VariableTypeDefaultPurpose
ERUN_IDLE_PROBEbool literal trueunsetHint that the CLI is being invoked by the desktop's idle prober. When set, suppresses interactive output.
Docker / Helm / kubectl standard variablesvariousper toolHonoured as documented by each tool (e.g. DOCKER_HOST, KUBECONFIG, HELM_NAMESPACE).

Variables NOT read by ERun

The following look ERun-related but are not consumed:

  • ERUN_VERSION — compiled into the binary at build time (-ldflags -X main.Version=…). Not read from the environment.
  • ERUN_HOME — there is no such variable; per-user config lives under ~/.config/erun/ (or the OS-equivalent path; see Config locations).

A variable not in either table above is ignored.