[FEATURE]: single offline switch to disable runtime network (OPENCODE_OFFLINE) · Issue #57743 · anomalyco/opencode · GitHub
Skip to content

[FEATURE]: single offline switch to disable runtime network (OPENCODE_OFFLINE) #57743

Open

Description

@PJ-Zetier

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

Running opencode on airgapped/offline machines currently requires a pile of separate knobs — OPENCODE_DISABLE_AUTOUPDATE, OPENCODE_DISABLE_MODELS_FETCH + OPENCODE_MODELS_PATH, .npmrc offline=true, a pre-seeded ripgrep — and still trips over paths those don't cover. Two flags the docs mention (OPENCODE_DISABLE_LSP_DOWNLOAD, OPENCODE_DISABLE_DEFAULT_PLUGINS) are no-ops in v2: they only exist in the docs.

Proposal: one explicit env switch, OPENCODE_OFFLINE=1, that makes every runtime-network feature behave as if offline:

  • skip the update check (same as OPENCODE_DISABLE_AUTOUPDATE)
  • disable the models.dev fetch (bundled snapshot / OPENCODE_MODELS_PATH still serve the catalog)
  • force the npm/Arborist stack to offline mode (cache-only, instant failure; explicit user npm config still wins)
  • skip the ripgrep download (PATH lookup only, clear error otherwise)

Explicit flag only, no auto-detection. I have a working implementation with tests ready to open as a PR if the design is acceptable (fork branch PJ-Zetier/opencode@offline-startup-bounds, commit b5bbf75) — happy to adjust naming and scope.

Activity

  1. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed proposal! You're asking for a single explicit OPENCODE_OFFLINE=1 switch that makes every runtime network feature in v2 act as offline: the update check, the models.dev fetch, npm/Arborist installs and the ripgrep download. Today that takes a set of separate knobs, and some paths still aren't covered.

    You're right that OPENCODE_DISABLE_LSP_DOWNLOAD and OPENCODE_DISABLE_DEFAULT_PLUGINS are only in the docs. Nothing in the current v2 code reads them. The maintainers will consider the design. Thanks for offering the implementation.

    Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions