You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
The v2 install script (https://opencode.ai/v2/install) downloads the CLI from the npm registry, but the registry URL is hardcoded to https://registry.npmjs.org in three places:
the version check for @opencode/cli-<target>
the fallback check for @opencode-ai/cli-<target>
the tarball download ($registry/$package_name/-/cli-<target>-<version>.tgz)
In corporate and CI environments, outbound traffic is often only allowed to an internal npm mirror (Artifactory, Nexus, Verdaccio, …). Those environments already set NPM_CONFIG_REGISTRY, but the installer ignores it, so installing v2 fails even though the mirror serves the exact same packages.
and use $registry for all three URLs. Respecting NPM_CONFIG_REGISTRY (and/or npm_config_registry) matches what npm users expect; a dedicated OPENCODE_NPM_REGISTRY would allow an override for opencode only. Optionally, document it next to --version in the usage text.
Related: with no --version, the installer also fetches https://opencode.ai/update/api/latest/cli/npm. When a version is pinned that call is skipped, so pinning plus a registry override would make the install work entirely offline from opencode.ai (apart from fetching the script itself).
Tested with v2.4.2: with the registry rewritten, installing through an Artifactory npm remote works, including the encoded @opencode%2fcli-linux-x64/<version> metadata check.
Thanks for the detailed write-up and the workaround, @fellinga!
I think this is a duplicate of #57797, which asks the same thing: make the install script use NPM_CONFIG_REGISTRY / npm_config_registry (without the trailing slash) instead of the hardcoded https://registry.npmjs.org. The current script still hardcodes it in the three places you point out: the version check, the @opencode-ai fallback check and the tarball download.
Related issues and pull requests, ordered by likelihood:
I'm closing this issue now as a duplicate of #57797. Please add your extra points there: the dedicated OPENCODE_NPM_REGISTRY override, and that a pinned --version means the install never contacts opencode.ai. If you think this isn't a duplicate, reply here and the issue will reopen.
Activity
opencodejr commentedon Nov 27, 2026
Thanks for the detailed write-up and the workaround, @fellinga!
I think this is a duplicate of #57797, which asks the same thing: make the
installscript useNPM_CONFIG_REGISTRY/npm_config_registry(without the trailing slash) instead of the hardcodedhttps://registry.npmjs.org. The current script still hardcodes it in the three places you point out: the version check, the@opencode-aifallback check and the tarball download.Related issues and pull requests, ordered by likelihood:
opencode update/upgradeto time out behind an Artifactory mirror (closed).I'm closing this issue now as a duplicate of #57797. Please add your extra points there: the dedicated
OPENCODE_NPM_REGISTRYoverride, and that a pinned--versionmeans the install never contacts opencode.ai. If you think this isn't a duplicate, reply here and the issue will reopen.