Environment variables
Full referenceOpenCode v1.18.34 reads 131 environment variables by name: 67 of its own and 64 that providers, the host or other tools define. Each was found where the code reads it (process.env, Bun.env, OpenCode's Flag helpers or Effect Config), and the reading code says what value it expects. Topics group them by what they control; whether one is set depends on the user's environment.
Experimental features
OPENCODE_EXPERIMENTAL
Read 2 times, in 2 files. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:12, core/src/tool/websearch.ts:79
return process.env[key] === undefined ? truthy("OPENCODE_EXPERIMENTAL") : truthy(key)
enableExa: truthy("OPENCODE_EXPERIMENTAL") || truthy("OPENCODE_ENABLE_EXA") || truthy("OPENCODE_EXPERIMENTAL_EXA"),
OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS
Read once, in opencode/src/effect/runtime-flags.ts. Value: boolean: true when set to "true" or "1".
Source: opencode/src/effect/runtime-flags.ts:43
experimentalBackgroundSubagents: enabledByExperimental("OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS"),
OPENCODE_EXPERIMENTAL_CODE_MODE
Read once, in opencode/src/effect/runtime-flags.ts. Value: boolean: true when set to "true" or "1".
Source: opencode/src/effect/runtime-flags.ts:48
experimentalCodeMode: enabledByExperimental("OPENCODE_EXPERIMENTAL_CODE_MODE"),
OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT
Read 2 times, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:8, core/src/flag/flag.ts:44
const copy = process.env["OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT"]
copy === undefined ? process.platform === "win32" : truthy("OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT"),
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER
Read once, in core/src/flag/flag.ts. Value: boolean (Effect Config).
Source: core/src/flag/flag.ts:40
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: Config.boolean("OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER").pipe(
OPENCODE_EXPERIMENTAL_EVENT_SYSTEM
Read once, in opencode/src/effect/runtime-flags.ts. Value: boolean: true when set to "true" or "1".
Source: opencode/src/effect/runtime-flags.ts:49
experimentalEventSystem: enabledByExperimental("OPENCODE_EXPERIMENTAL_EVENT_SYSTEM"),
OPENCODE_EXPERIMENTAL_EXA
Read once, in core/src/tool/websearch.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/tool/websearch.ts:79
enableExa: truthy("OPENCODE_EXPERIMENTAL") || truthy("OPENCODE_ENABLE_EXA") || truthy("OPENCODE_EXPERIMENTAL_EXA"),
OPENCODE_EXPERIMENTAL_FILEWATCHER
Read once, in core/src/flag/flag.ts. Value: boolean (Effect Config).
Source: core/src/flag/flag.ts:37
OPENCODE_EXPERIMENTAL_FILEWATCHER: Config.boolean("OPENCODE_EXPERIMENTAL_FILEWATCHER").pipe(
OPENCODE_EXPERIMENTAL_ICON_DISCOVERY
Read once, in opencode/src/effect/runtime-flags.ts. Value: boolean: true when set to "true" or "1".
Source: opencode/src/effect/runtime-flags.ts:51
experimentalIconDiscovery: enabledByExperimental("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY"),
OPENCODE_EXPERIMENTAL_LSP_TOOL
Read once, in opencode/src/effect/runtime-flags.ts. Value: boolean: true when set to "true" or "1".
Source: opencode/src/effect/runtime-flags.ts:45
experimentalLspTool: enabledByExperimental("OPENCODE_EXPERIMENTAL_LSP_TOOL"),
OPENCODE_EXPERIMENTAL_OXFMT
Read once, in opencode/src/effect/runtime-flags.ts. Value: boolean: true when set to "true" or "1".
Source: opencode/src/effect/runtime-flags.ts:46
experimentalOxfmt: enabledByExperimental("OPENCODE_EXPERIMENTAL_OXFMT"),
OPENCODE_EXPERIMENTAL_PARALLEL
Read once, in core/src/tool/websearch.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/tool/websearch.ts:80
enableParallel: truthy("OPENCODE_ENABLE_PARALLEL") || truthy("OPENCODE_EXPERIMENTAL_PARALLEL"),
OPENCODE_EXPERIMENTAL_PLAN_MODE
Read once, in opencode/src/effect/runtime-flags.ts. Value: boolean: true when set to "true" or "1".
Source: opencode/src/effect/runtime-flags.ts:47
experimentalPlanMode: enabledByExperimental("OPENCODE_EXPERIMENTAL_PLAN_MODE"),
OPENCODE_EXPERIMENTAL_REFERENCES
Read 2 times, in 2 files. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:58, opencode/src/effect/runtime-flags.ts:42
return enabledByExperimental("OPENCODE_EXPERIMENTAL_REFERENCES")
experimentalReferences: enabledByExperimental("OPENCODE_EXPERIMENTAL_REFERENCES"),
OPENCODE_EXPERIMENTAL_WORKSPACES
Read 2 times, in 2 files. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:50, opencode/src/effect/runtime-flags.ts:50
OPENCODE_EXPERIMENTAL_WORKSPACES: enabledByExperimental("OPENCODE_EXPERIMENTAL_WORKSPACES"),
experimentalWorkspaces: enabledByExperimental("OPENCODE_EXPERIMENTAL_WORKSPACES"),
Model providers and credentials
AICORE_DEPLOYMENT_ID
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/sap-ai-core.ts:34, opencode/src/provider/provider.ts:628
? { deploymentId: process.env.AICORE_DEPLOYMENT_ID, resourceGroup: process.env.AICORE_RESOURCE_GROUP }
const deploymentId = process.env.AICORE_DEPLOYMENT_ID
AICORE_RESOURCE_GROUP
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/sap-ai-core.ts:34, opencode/src/provider/provider.ts:629
? { deploymentId: process.env.AICORE_DEPLOYMENT_ID, resourceGroup: process.env.AICORE_RESOURCE_GROUP }
const resourceGroup = process.env.AICORE_RESOURCE_GROUP
AICORE_SERVICE_KEY
Read 5 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/sap-ai-core.ts:15, core/src/plugin/provider/sap-ai-core.ts:17, core/src/plugin/provider/sap-ai-core.ts:17, opencode/src/provider/provider.ts:620 and 1 more
process.env.AICORE_SERVICE_KEY ??
if (serviceKey && !process.env.AICORE_SERVICE_KEY) process.env.AICORE_SERVICE_KEY = serviceKey
const envAICoreServiceKey = process.env.AICORE_SERVICE_KEY
AWS_BEARER_TOKEN_BEDROCK
Read 5 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/amazon-bedrock.ts:96, core/src/plugin/provider/amazon-bedrock.ts:98, core/src/plugin/provider/amazon-bedrock.ts:98, opencode/src/provider/provider.ts:357 and 1 more
process.env.AWS_BEARER_TOKEN_BEDROCK ??
if (bearerToken && !process.env.AWS_BEARER_TOKEN_BEDROCK) process.env.AWS_BEARER_TOKEN_BEDROCK = bearerToken
const envToken = process.env.AWS_BEARER_TOKEN_BEDROCK
AWS_CONTAINER_CREDENTIALS_FULL_URI
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/amazon-bedrock.ts:100, opencode/src/provider/provider.ts:369
process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI || process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI,
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/amazon-bedrock.ts:100, opencode/src/provider/provider.ts:369
process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI || process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI,
AWS_PROFILE
Read once, in core/src/plugin/provider/amazon-bedrock.ts. Value: string, read as set.
Source: core/src/plugin/provider/amazon-bedrock.ts:93
const profile = typeof options.profile === "string" ? options.profile : process.env.AWS_PROFILE
AWS_REGION
Read 2 times, in core/src/plugin/provider/amazon-bedrock.ts. Value: string, read as set.
Source: core/src/plugin/provider/amazon-bedrock.ts:94, core/src/plugin/provider/amazon-bedrock.ts:129
const region = typeof options.region === "string" ? options.region : (process.env.AWS_REGION ?? "us-east-1")
const region = typeof evt.options.region === "string" ? evt.options.region : process.env.AWS_REGION
AZURE_COGNITIVE_SERVICES_RESOURCE_NAME
Read once, in core/src/plugin/provider/azure.ts. Value: string, read as set.
Source: core/src/plugin/provider/azure.ts:63
const resourceName = process.env.AZURE_COGNITIVE_SERVICES_RESOURCE_NAME
AZURE_RESOURCE_NAME
Read 3 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/azure.ts:23, opencode/src/plugin/azure.ts:46, opencode/src/plugin/azure.ts:89
typeof configured === "string" && configured.trim() !== "" ? configured : process.env.AZURE_RESOURCE_NAME
if (!process.env.AZURE_RESOURCE_NAME) {
const resourceName = inputs?.resourceName ?? process.env.AZURE_RESOURCE_NAME
CF_AIG_TOKEN
Read once, in core/src/plugin/provider/cloudflare-ai-gateway.ts. Value: string, read as set.
Source: core/src/plugin/provider/cloudflare-ai-gateway.ts:58
const apiKey = process.env.CLOUDFLARE_API_TOKEN ?? process.env.CF_AIG_TOKEN ?? stringOption(options, "apiKey")
CLOUDFLARE_ACCOUNT_ID
Read 5 times, in 3 files. Value: string, read as set.
Source: core/src/plugin/provider/cloudflare-ai-gateway.ts:53, core/src/plugin/provider/cloudflare-workers-ai.ts:50, core/src/plugin/provider/cloudflare-workers-ai.ts:76, opencode/src/plugin/cloudflare.ts:4 and 1 more
const accountId = process.env.CLOUDFLARE_ACCOUNT_ID ?? stringOption(options, "accountId")
return process.env.CLOUDFLARE_ACCOUNT_ID ?? stringOption(options, "accountId")
return baseURL.replaceAll("${CLOUDFLARE_ACCOUNT_ID}", process.env.CLOUDFLARE_ACCOUNT_ID ?? "${CLOUDFLARE_ACCOUNT_ID}")
CLOUDFLARE_API_KEY
Read once, in core/src/plugin/provider/cloudflare-workers-ai.ts. Value: string, read as set.
Source: core/src/plugin/provider/cloudflare-workers-ai.ts:65
apiKey: process.env.CLOUDFLARE_API_KEY ?? options.apiKey,
CLOUDFLARE_API_TOKEN
Read once, in core/src/plugin/provider/cloudflare-ai-gateway.ts. Value: string, read as set.
Source: core/src/plugin/provider/cloudflare-ai-gateway.ts:58
const apiKey = process.env.CLOUDFLARE_API_TOKEN ?? process.env.CF_AIG_TOKEN ?? stringOption(options, "apiKey")
CLOUDFLARE_GATEWAY_ID
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/plugin/provider/cloudflare-ai-gateway.ts:57, opencode/src/plugin/cloudflare.ts:41
process.env.CLOUDFLARE_GATEWAY_ID ?? stringOption(options, "gatewayId") ?? stringOption(options, "gateway")
...(!process.env.CLOUDFLARE_GATEWAY_ID
EXA_API_KEY
Read 3 times, in 2 files. Value: string, read as set.
Source: core/src/tool/websearch.ts:81, opencode/src/tool/mcp-websearch.ts:4, opencode/src/tool/mcp-websearch.ts:5
exaApiKey: process.env.EXA_API_KEY,
export const EXA_URL = process.env.EXA_API_KEY
? `https://mcp.exa.ai/mcp?exaApiKey=${encodeURIComponent(process.env.EXA_API_KEY)}`
GCLOUD_PROJECT
Read 3 times, in core/src/plugin/provider/google-vertex.ts. Value: string, read as set.
Source: core/src/plugin/provider/google-vertex.ts:13, core/src/plugin/provider/google-vertex.ts:127, core/src/plugin/provider/google-vertex.ts:147
process.env.GCLOUD_PROJECT
: (process.env.GOOGLE_CLOUD_PROJECT ?? process.env.GCP_PROJECT ?? process.env.GCLOUD_PROJECT)
GCP_PROJECT
Read 3 times, in core/src/plugin/provider/google-vertex.ts. Value: string, read as set.
Source: core/src/plugin/provider/google-vertex.ts:12, core/src/plugin/provider/google-vertex.ts:126, core/src/plugin/provider/google-vertex.ts:147
process.env.GCP_PROJECT ??
: (process.env.GOOGLE_CLOUD_PROJECT ?? process.env.GCP_PROJECT ?? process.env.GCLOUD_PROJECT)
GITLAB_INSTANCE_URL
Read once, in core/src/plugin/provider/gitlab.ts. Value: string, read as set.
Source: core/src/plugin/provider/gitlab.ts:19
: (process.env.GITLAB_INSTANCE_URL ?? "https://gitlab.com"),
GITLAB_TOKEN
Read once, in core/src/plugin/provider/gitlab.ts. Value: string, read as set.
Source: core/src/plugin/provider/gitlab.ts:20
apiKey: typeof evt.options.apiKey === "string" ? evt.options.apiKey : process.env.GITLAB_TOKEN,
GOOGLE_CLOUD_LOCATION
Read 3 times, in core/src/plugin/provider/google-vertex.ts. Value: string, read as set.
Source: core/src/plugin/provider/google-vertex.ts:21, core/src/plugin/provider/google-vertex.ts:130, core/src/plugin/provider/google-vertex.ts:151
process.env.GOOGLE_CLOUD_LOCATION ??
: (process.env.GOOGLE_CLOUD_LOCATION ?? process.env.VERTEX_LOCATION ?? "global")
GOOGLE_CLOUD_PROJECT
Read 3 times, in core/src/plugin/provider/google-vertex.ts. Value: string, read as set.
Source: core/src/plugin/provider/google-vertex.ts:11, core/src/plugin/provider/google-vertex.ts:125, core/src/plugin/provider/google-vertex.ts:147
process.env.GOOGLE_CLOUD_PROJECT ??
: (process.env.GOOGLE_CLOUD_PROJECT ?? process.env.GCP_PROJECT ?? process.env.GCLOUD_PROJECT)
GOOGLE_VERTEX_LOCATION
Read once, in core/src/plugin/provider/google-vertex.ts. Value: string, read as set.
Source: core/src/plugin/provider/google-vertex.ts:20
process.env.GOOGLE_VERTEX_LOCATION ??
GOOGLE_VERTEX_PROJECT
Read once, in core/src/plugin/provider/google-vertex.ts. Value: string, read as set.
Source: core/src/plugin/provider/google-vertex.ts:10
process.env.GOOGLE_VERTEX_PROJECT ??
MODAL_PROXY_TOKEN
Read once, in opencode/src/plugin/modal/modal.ts. Value: string, read as set.
Source: opencode/src/plugin/modal/modal.ts:9
const apiKey = ctx.auth?.type === "api" ? ctx.auth.key : process.env.MODAL_PROXY_TOKEN
OPENCODE_API_KEY
Read once, in core/src/plugin/provider/opencode.ts. Value: string, read as set.
Source: core/src/plugin/provider/opencode.ts:176
const hasKey = Boolean(process.env.OPENCODE_API_KEY || connected || item.provider.request.body.apiKey)
OPENCODE_AUTH_CONTENT
Read 2 times, in opencode/src/auth/index.ts. Value: string, read as set.
Source: opencode/src/auth/index.ts:59, opencode/src/auth/index.ts:61
if (process.env.OPENCODE_AUTH_CONTENT) {
return JSON.parse(process.env.OPENCODE_AUTH_CONTENT)
OPENCODE_CONSOLE_TOKEN
Read once, in opencode/src/config/config.ts. Value: string, read as set.
Source: opencode/src/config/config.ts:505
process.env["OPENCODE_CONSOLE_TOKEN"] = tokenOpt.value
OPENCODE_ENABLE_EXA
Read once, in core/src/tool/websearch.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/tool/websearch.ts:79
enableExa: truthy("OPENCODE_EXPERIMENTAL") || truthy("OPENCODE_ENABLE_EXA") || truthy("OPENCODE_EXPERIMENTAL_EXA"),
OPENCODE_ENABLE_PARALLEL
Read once, in core/src/tool/websearch.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/tool/websearch.ts:80
enableParallel: truthy("OPENCODE_ENABLE_PARALLEL") || truthy("OPENCODE_EXPERIMENTAL_PARALLEL"),
OPENCODE_WEBSEARCH_PROVIDER
Read 4 times, in 2 files. Value: string, read as set.
Source: core/src/tool/websearch.ts:76, core/src/tool/websearch.ts:76, core/src/tool/websearch.ts:77, opencode/src/tool/websearch.ts:31
process.env.OPENCODE_WEBSEARCH_PROVIDER === "exa" || process.env.OPENCODE_WEBSEARCH_PROVIDER === "parallel"
? process.env.OPENCODE_WEBSEARCH_PROVIDER
const override = process.env.OPENCODE_WEBSEARCH_PROVIDER
PARALLEL_API_KEY
Read 3 times, in 2 files. Value: string, read as set.
Source: core/src/tool/websearch.ts:82, opencode/src/tool/websearch.ts:56, opencode/src/tool/websearch.ts:57
parallelApiKey: process.env.PARALLEL_API_KEY,
if (!process.env.PARALLEL_API_KEY) return headers
return { ...headers, Authorization: `Bearer ${process.env.PARALLEL_API_KEY}` }
SNOWFLAKE_CORTEX_PAT
Read once, in core/src/plugin/provider/snowflake-cortex.ts. Value: string, read as set.
Source: core/src/plugin/provider/snowflake-cortex.ts:75
process.env.SNOWFLAKE_CORTEX_PAT ??
SNOWFLAKE_CORTEX_TOKEN
Read once, in core/src/plugin/provider/snowflake-cortex.ts. Value: string, read as set.
Source: core/src/plugin/provider/snowflake-cortex.ts:74
process.env.SNOWFLAKE_CORTEX_TOKEN ??
VERTEX_LOCATION
Read 3 times, in core/src/plugin/provider/google-vertex.ts. Value: string, read as set.
Source: core/src/plugin/provider/google-vertex.ts:22, core/src/plugin/provider/google-vertex.ts:131, core/src/plugin/provider/google-vertex.ts:151
process.env.VERTEX_LOCATION ??
: (process.env.GOOGLE_CLOUD_LOCATION ?? process.env.VERTEX_LOCATION ?? "global")
Configuration, data and paths
OPENCODE_CONFIG
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:21
OPENCODE_CONFIG: process.env["OPENCODE_CONFIG"],
OPENCODE_CONFIG_CONTENT
Read 3 times, in 2 files. Value: string, read as set.
Source: core/src/flag/flag.ts:22, opencode/src/config/config.ts:482, opencode/src/config/config.ts:484
OPENCODE_CONFIG_CONTENT: process.env["OPENCODE_CONFIG_CONTENT"],
if (process.env.OPENCODE_CONFIG_CONTENT) {
const next = yield* loadConfig(process.env.OPENCODE_CONFIG_CONTENT, {
OPENCODE_CONFIG_DIR
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:64
return process.env["OPENCODE_CONFIG_DIR"]
OPENCODE_DB
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:47
OPENCODE_DB: process.env["OPENCODE_DB"],
OPENCODE_DISABLE_CHANNEL_DB
Read 2 times, in core/src/database/database.ts. Value: string, read as set.
Source: core/src/database/database.ts:50, core/src/database/database.ts:51
process.env.OPENCODE_DISABLE_CHANNEL_DB === "1" ||
process.env.OPENCODE_DISABLE_CHANNEL_DB === "true"
OPENCODE_DISABLE_MODELS_FETCH
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:29
OPENCODE_DISABLE_MODELS_FETCH: truthy("OPENCODE_DISABLE_MODELS_FETCH"),
OPENCODE_DISABLE_PROJECT_CONFIG
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:55
return truthy("OPENCODE_DISABLE_PROJECT_CONFIG")
OPENCODE_MODELS_PATH
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:46
OPENCODE_MODELS_PATH: process.env["OPENCODE_MODELS_PATH"],
OPENCODE_MODELS_URL
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:45
OPENCODE_MODELS_URL: process.env["OPENCODE_MODELS_URL"],
OPENCODE_PERMISSION
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:70
return process.env["OPENCODE_PERMISSION"]
OPENCODE_PLUGIN_META_FILE
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:73
return process.env["OPENCODE_PLUGIN_META_FILE"]
OPENCODE_PURE
Read 2 times, in 2 files. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:67, opencode/src/index.ts:70
return truthy("OPENCODE_PURE")
process.env.OPENCODE_PURE = "1"
OPENCODE_TEST_HOME
Read once, in core/src/global.ts. Value: string, read as set.
Source: core/src/global.ts:19
return process.env.OPENCODE_TEST_HOME ?? os.homedir()
OPENCODE_TEST_MANAGED_CONFIG_DIR
Read once, in opencode/src/config/managed.ts. Value: string, read as set.
Source: opencode/src/config/managed.ts:32
return process.env.OPENCODE_TEST_MANAGED_CONFIG_DIR || systemManagedConfigDir()
OPENCODE_TUI_CONFIG
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:61
return process.env["OPENCODE_TUI_CONFIG"]
OPENCODE_ZED_DB
Read once, in tui/src/editor-zed.ts. Value: string, read as set.
Source: tui/src/editor-zed.ts:189
process.env.OPENCODE_ZED_DB,
XDG_CONFIG_HOME
Read once, in opencode/src/cli/cmd/uninstall.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/uninstall.ts:238
const xdgConfig = process.env.XDG_CONFIG_HOME || path.join(home, ".config")
Server, sharing and GitHub
AGENT
Read once, in opencode/src/index.ts. Value: string, read as set.
Source: opencode/src/index.ts:75
process.env.AGENT = "1"
GITHUB_RUN_ID
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:675
const value = process.env["GITHUB_RUN_ID"]
GITHUB_TOKEN
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:474
const githubToken = process.env["GITHUB_TOKEN"]
MENTIONS
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:747
const mentions = (process.env["MENTIONS"] || "/opencode,/oc")
MODEL
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:664
const value = process.env["MODEL"]
OPENCODE_CALLER
Read 2 times, in opencode/src/ide/index.ts. Value: string, read as set.
Source: opencode/src/ide/index.ts:33, opencode/src/ide/index.ts:33
return process.env["OPENCODE_CALLER"] === "vscode" || process.env["OPENCODE_CALLER"] === "vscode-insiders"
OPENCODE_CLIENT
Read 3 times, in 3 files. Value: string, read as set; default "cli".
Source: core/src/flag/flag.ts:76, opencode/src/cli/cmd/acp.ts:23, opencode/src/effect/runtime-flags.ts:56
return process.env["OPENCODE_CLIENT"] ?? "cli"
process.env.OPENCODE_CLIENT = "acp"
client: Config.string("OPENCODE_CLIENT").pipe(Config.withDefault("cli")),
OPENCODE_DISABLE_SHARE
Read 2 times, in opencode/src/share/share-next.ts. Value: string, read as set.
Source: opencode/src/share/share-next.ts:23, opencode/src/share/share-next.ts:23
const disabled = process.env["OPENCODE_DISABLE_SHARE"] === "true" || process.env["OPENCODE_DISABLE_SHARE"] === "1"
OPENCODE_REPO_CLONE_GITHUB_BASE_URL
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/repository.ts:175, opencode/src/util/repository.ts:100
const base = process.env.OPENCODE_REPO_CLONE_GITHUB_BASE_URL
OPENCODE_ROUTE
Read 2 times, in tui/src/app.tsx. Value: string, read as set.
Source: tui/src/app.tsx:277, tui/src/app.tsx:277
initialRoute: process.env.OPENCODE_ROUTE ? JSON.parse(process.env.OPENCODE_ROUTE) : undefined,
OPENCODE_SERVER_PASSWORD
Read 3 times, in 3 files. Value: string, read as set.
Source: core/src/flag/flag.ts:32, opencode/src/effect/config-service.ts:33, server/src/auth.ts:53
OPENCODE_SERVER_PASSWORD: process.env["OPENCODE_SERVER_PASSWORD"],
* password: Config.string("OPENCODE_SERVER_PASSWORD").pipe(Config.option),
const password = credentials?.password ?? process.env.OPENCODE_SERVER_PASSWORD
OPENCODE_SERVER_USERNAME
Read 3 times, in 3 files. Value: string, read as set; default "opencode".
Source: core/src/flag/flag.ts:33, opencode/src/effect/config-service.ts:34, server/src/auth.ts:56
OPENCODE_SERVER_USERNAME: process.env["OPENCODE_SERVER_USERNAME"],
* username: Config.string("OPENCODE_SERVER_USERNAME").pipe(Config.withDefault("opencode")),
return `Basic ${Buffer.from(`${credentials?.username ?? process.env.OPENCODE_SERVER_USERNAME ?? "opencode"}:${password}`).toString("base64")}`
OPENCODE_WORKSPACE_ID
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:49
OPENCODE_WORKSPACE_ID: process.env["OPENCODE_WORKSPACE_ID"],
PROMPT
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:732
const customPrompt = process.env["PROMPT"]
SHARE
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:681
const value = process.env["SHARE"]
USE_GITHUB_TOKEN
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:689
const value = process.env["USE_GITHUB_TOKEN"]
VARIANT
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:408
const variant = process.env["VARIANT"] || undefined
Logging, tracing and diagnostics
OPENCODE_AUTO_HEAP_SNAPSHOT
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:19
OPENCODE_AUTO_HEAP_SNAPSHOT: truthy("OPENCODE_AUTO_HEAP_SNAPSHOT"),
OPENCODE_DIRECT_TRACE
Read once, in opencode/src/cli/cmd/run/trace.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/run/trace.ts:58
if (!process.env.OPENCODE_DIRECT_TRACE) {
OPENCODE_LOG_LEVEL
Read 3 times, in 3 files. Value: string, read as set.
Source: core/src/observability/logging.ts:57, opencode/src/index.ts:68, opencode/src/temporary.ts:28
const value = process.env.OPENCODE_LOG_LEVEL?.toUpperCase()
if (opts.logLevel) process.env.OPENCODE_LOG_LEVEL = opts.logLevel
OPENCODE_PRINT_LOGS
Read 3 times, in 3 files. Value: string, read as set.
Source: core/src/observability/logging.ts:68, opencode/src/index.ts:67, opencode/src/temporary.ts:27
return process.env.OPENCODE_PRINT_LOGS === "1" ? [fileLogger(), stderrLogger] : [fileLogger()]
if (opts.printLogs) process.env.OPENCODE_PRINT_LOGS = "1"
OPENCODE_SHOW_TTFD
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:27
OPENCODE_SHOW_TTFD: truthy("OPENCODE_SHOW_TTFD"),
OTEL_EXPORTER_OTLP_ENDPOINT
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/flag/flag.ts:16, opencode/src/control-plane/workspace.ts:534
OTEL_EXPORTER_OTLP_ENDPOINT: process.env["OTEL_EXPORTER_OTLP_ENDPOINT"],
OTEL_EXPORTER_OTLP_ENDPOINT: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
OTEL_EXPORTER_OTLP_HEADERS
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/flag/flag.ts:17, opencode/src/control-plane/workspace.ts:533
OTEL_EXPORTER_OTLP_HEADERS: process.env["OTEL_EXPORTER_OTLP_HEADERS"],
OTEL_EXPORTER_OTLP_HEADERS: process.env.OTEL_EXPORTER_OTLP_HEADERS,
OTEL_RESOURCE_ATTRIBUTES
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/observability/otlp.ts:21, opencode/src/control-plane/workspace.ts:535
const value = process.env.OTEL_RESOURCE_ATTRIBUTES
OTEL_RESOURCE_ATTRIBUTES: process.env.OTEL_RESOURCE_ATTRIBUTES,
Session and editor behavior
CLAUDE_CODE_SSE_PORT
Read once, in tui/src/context/editor.ts. Value: string, read as set.
Source: tui/src/context/editor.ts:117
const value = process.env.CLAUDE_CODE_SSE_PORT || process.env.OPENCODE_EDITOR_SSE_PORT
OPENCODE_ACP_PROFILE
Read once, in opencode/src/acp/profile.ts. Value: string, read as set.
Source: opencode/src/acp/profile.ts:1
const enabled = process.env.OPENCODE_ACP_PROFILE === "1"
OPENCODE_ALWAYS_NOTIFY_UPDATE
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:24
OPENCODE_ALWAYS_NOTIFY_UPDATE: truthy("OPENCODE_ALWAYS_NOTIFY_UPDATE"),
OPENCODE_BUMP
Read once, in script/src/index.ts. Value: string, read as set.
Source: script/src/index.ts:22
OPENCODE_BUMP: process.env["OPENCODE_BUMP"],
OPENCODE_CHANNEL
Read once, in script/src/index.ts. Value: string, read as set.
Source: script/src/index.ts:21
OPENCODE_CHANNEL: process.env["OPENCODE_CHANNEL"],
OPENCODE_DISABLE_AUTOCOMPACT
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:28
OPENCODE_DISABLE_AUTOCOMPACT: truthy("OPENCODE_DISABLE_AUTOCOMPACT"),
OPENCODE_DISABLE_AUTOUPDATE
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:23
OPENCODE_DISABLE_AUTOUPDATE: truthy("OPENCODE_DISABLE_AUTOUPDATE"),
OPENCODE_DISABLE_FFF
Read 2 times, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:9, core/src/flag/flag.ts:34
const fff = process.env["OPENCODE_DISABLE_FFF"]
OPENCODE_DISABLE_FFF: fff === undefined ? process.platform === "win32" : truthy("OPENCODE_DISABLE_FFF"),
OPENCODE_DISABLE_MOUSE
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:30
OPENCODE_DISABLE_MOUSE: truthy("OPENCODE_DISABLE_MOUSE"),
OPENCODE_DISABLE_PRUNE
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:25
OPENCODE_DISABLE_PRUNE: truthy("OPENCODE_DISABLE_PRUNE"),
OPENCODE_DISABLE_TERMINAL_TITLE
Read once, in core/src/flag/flag.ts. Value: boolean: true when set to "true" or "1".
Source: core/src/flag/flag.ts:26
OPENCODE_DISABLE_TERMINAL_TITLE: truthy("OPENCODE_DISABLE_TERMINAL_TITLE"),
OPENCODE_EDITOR_SSE_PORT
Read once, in tui/src/context/editor.ts. Value: string, read as set.
Source: tui/src/context/editor.ts:117
const value = process.env.CLAUDE_CODE_SSE_PORT || process.env.OPENCODE_EDITOR_SSE_PORT
OPENCODE_FAKE_VCS
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:31
OPENCODE_FAKE_VCS: process.env["OPENCODE_FAKE_VCS"],
OPENCODE_FAST_BOOT
Read once, in tui/src/app.tsx. Value: string, read as set.
Source: tui/src/app.tsx:278
skipInitialLoading: Boolean(process.env.OPENCODE_FAST_BOOT),
OPENCODE_GIT_BASH_PATH
Read once, in core/src/flag/flag.ts. Value: string, read as set.
Source: core/src/flag/flag.ts:20
OPENCODE_GIT_BASH_PATH: process.env["OPENCODE_GIT_BASH_PATH"],
OPENCODE_PID
Read once, in opencode/src/index.ts. Value: string, read as set.
Source: opencode/src/index.ts:77
process.env.OPENCODE_PID = String(process.pid)
OPENCODE_RELEASE
Read once, in script/src/index.ts. Value: string, read as set.
Source: script/src/index.ts:24
OPENCODE_RELEASE: process.env["OPENCODE_RELEASE"],
OPENCODE_VERSION
Read once, in script/src/index.ts. Value: string, read as set.
Source: script/src/index.ts:23
OPENCODE_VERSION: process.env["OPENCODE_VERSION"],
VSCODE_EXTENSIONS
Read once, in opencode/src/lsp/server.ts. Value: string, read as set.
Source: opencode/src/lsp/server.ts:789
process.env.VSCODE_EXTENSIONS,
ZED_TERM
Read 2 times, in 2 files. Value: string, read as set.
Source: tui/src/context/editor.ts:121, tui/src/editor-zed.ts:198
const zedTerminal = process.env.ZED_TERM === "true" || process.env.TERM_PROGRAM?.toLowerCase() === "zed"
return process.env.ZED_TERM === "true" || process.env.TERM_PROGRAM?.toLowerCase() === "zed"
Host environment
COMSPEC
Read 2 times, in 2 files. Value: string, read as set.
Source: core/src/shell.ts:101, core/src/tool/bash.ts:49
[which("pwsh"), which("powershell"), gitbash(), process.env.COMSPEC || "cmd.exe"]
const defaultShell = () => (process.platform === "win32" ? (process.env.COMSPEC ?? "cmd.exe") : "/bin/sh")
DISPLAY
Read once, in tui/src/app.tsx. Value: string, read as set.
Source: tui/src/app.tsx:270
: process.env.DISPLAY
DOTNET_CLI_HOME
Read once, in opencode/src/lsp/server.ts. Value: string, read as set.
Source: opencode/src/lsp/server.ts:779
process.env.DOTNET_CLI_HOME ?? os.homedir(),
EDITOR
Read once, in tui/src/editor.ts. Value: string, read as set.
Source: tui/src/editor.ts:27
const editor = process.env.VISUAL || process.env.EDITOR
GIT_ASKPASS
Read once, in opencode/src/ide/index.ts. Value: string, read as set.
Source: opencode/src/ide/index.ts:24
const v = process.env["GIT_ASKPASS"]
OIDC_BASE_URL
Read once, in opencode/src/cli/cmd/github.handler.ts. Value: string, read as set.
Source: opencode/src/cli/cmd/github.handler.ts:697
const value = process.env["OIDC_BASE_URL"]
OPENCODE
Read once, in opencode/src/index.ts. Value: string, read as set.
Source: opencode/src/index.ts:76
process.env.OPENCODE = "1"
PATH
Read once, in core/src/util/which.ts. Value: string, read as set.
Source: core/src/util/which.ts:6
const base = env?.PATH ?? env?.Path ?? process.env.PATH ?? process.env.Path ?? ""
PATHEXT
Read once, in core/src/util/which.ts. Value: string, read as set.
Source: core/src/util/which.ts:11
pathExt: env?.PATHEXT ?? env?.PathExt ?? process.env.PATHEXT ?? process.env.PathExt,
PWD
Read 2 times, in 2 files. Value: string, read as set.
Source: opencode/src/cli/cmd/run.ts:333, opencode/src/cli/cmd/tui.ts:66
const root = Filesystem.resolve(process.env.PWD ?? process.cwd())
export function resolveThreadDirectory(project?: string, envPWD = process.env.PWD, cwd = process.cwd()) {
SHELL
Read 3 times, in 2 files. Value: string, read as set.
Source: core/src/shell.ts:207, core/src/shell.ts:216, opencode/src/cli/cmd/uninstall.ts:236
defaultPreferred ??= select(process.env.SHELL)
defaultAcceptable ??= select(process.env.SHELL, { acceptable: true })
const shell = path.basename(process.env.SHELL || "bash")
STY
Read 3 times, in 3 files. Value: string, read as set.
Source: tui/src/app.tsx:267, tui/src/clipboard.ts:27, tui/src/util/system.ts:18
multiplexer: process.env.TMUX ? "tmux" : process.env.STY ? "screen" : undefined,
process.stdout.write(process.env.TMUX ? sequence + passthrough : process.env.STY ? passthrough : sequence)
const multiplexer = process.env.TMUX ? " in tmux" : process.env.STY ? " in screen" : ""
TERM
Read 2 times, in 2 files. Value: string, read as set.
Source: opencode/src/cli/cmd/debug/index.ts:59, tui/src/util/system.ts:16
const terminal = [termProgram, process.env.TERM].filter((item): item is string => Boolean(item)).join(" / ")
const program = process.env.TERM_PROGRAM || process.env.TERM || "unknown"
TERM_PROGRAM
Read 6 times, in 5 files. Value: string, read as set.
Source: opencode/src/cli/cmd/debug/index.ts:56, opencode/src/cli/cmd/debug/index.ts:57, opencode/src/ide/index.ts:23, tui/src/context/editor.ts:121 and 2 more
const termProgram = process.env.TERM_PROGRAM
? `${process.env.TERM_PROGRAM}${process.env.TERM_PROGRAM_VERSION ? ` ${process.env.TERM_PROGRAM_VERSION}` : ""}`
if (process.env["TERM_PROGRAM"] === "vscode") {
TERM_PROGRAM_VERSION
Read 4 times, in 2 files. Value: string, read as set.
Source: opencode/src/cli/cmd/debug/index.ts:57, opencode/src/cli/cmd/debug/index.ts:57, tui/src/util/system.ts:17, tui/src/util/system.ts:17
? `${process.env.TERM_PROGRAM}${process.env.TERM_PROGRAM_VERSION ? ` ${process.env.TERM_PROGRAM_VERSION}` : ""}`
const version = process.env.TERM_PROGRAM_VERSION ? ` ${process.env.TERM_PROGRAM_VERSION}` : ""
TMUX
Read 3 times, in 3 files. Value: string, read as set.
Source: tui/src/app.tsx:267, tui/src/clipboard.ts:27, tui/src/util/system.ts:18
multiplexer: process.env.TMUX ? "tmux" : process.env.STY ? "screen" : undefined,
process.stdout.write(process.env.TMUX ? sequence + passthrough : process.env.STY ? passthrough : sequence)
const multiplexer = process.env.TMUX ? " in tmux" : process.env.STY ? " in screen" : ""
VIRTUAL_ENV
Read 2 times, in opencode/src/lsp/server.ts. Value: string, read as set.
Source: opencode/src/lsp/server.ts:445, opencode/src/lsp/server.ts:502
const potentialVenvPaths = [process.env["VIRTUAL_ENV"], path.join(root, ".venv"), path.join(root, "venv")].filter(
VISUAL
Read once, in tui/src/editor.ts. Value: string, read as set.
Source: tui/src/editor.ts:27
const editor = process.env.VISUAL || process.env.EDITOR
WAYLAND_DISPLAY
Read 2 times, in 2 files. Value: string, read as set.
Source: tui/src/app.tsx:268, tui/src/clipboard.ts:102
displayServer: process.env.WAYLAND_DISPLAY
const native = copyCommand(platform(), Boolean(process.env.WAYLAND_DISPLAY), (name) => Boolean(which(name)))