Skip to content

[FEATURE]: Offline mode: disable non-essential outbound connections at runtime #18233

@dgruzd

Description

@dgruzd

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

OpenCode makes several outbound connections that are not directly related to LLM inference:

  • Auto-update checks (opencode.ai/install)
  • Session sharing (opncd.ai)
  • Web UI proxy (app.opencode.ai)

These are fine in normal usage, but users in privacy-sensitive or restricted-network environments (corporate firewalls, VPNs, regulated industries) want a way to disable them without resorting to OS-level firewall rules or environment-variable guesswork.

Related but distinct from #2224 (which covers installation in fully air-gapped environments where even Bun package resolution fails).

Solution

Add a single offline kill switch that disables all non-essential outbound connections.

Config (opencode.json)

{
  "$schema": "https://opencode.ai/config.json",
  "offline": true
}

Environment variable

OPENCODE_OFFLINE=true opencode

CLI flag

opencode --offline
opencode run --offline "fix the tests"
opencode serve --offline

Behavior when enabled

Connection Affected?
Auto-update checks (opencode.ai/install) ✅ Disabled
Session sharing (opncd.ai) + /share command hidden ✅ Disabled
Web UI proxy (app.opencode.ai) ✅ Disabled (returns 503)
LLM provider API calls ❌ Not affected
models.dev model catalog ❌ Not affected
Exa web/code search ❌ Not affected (user-initiated, already permission-gated)

The flag also acts as a superset of the existing granular flags (OPENCODE_DISABLE_AUTOUPDATE, OPENCODE_DISABLE_SHARE, OPENCODE_DISABLE_APP_PROXY) — enabling offline mode implies all of them.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions