Repository navigation
Open
Description
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
OpenCode currently supports proxy configuration through standard environment variables such as HTTPS_PROXY,
HTTP_PROXY, and NO_PROXY. This works for simple terminal usage, but it is hard to scope safely when different
developer tools on the same machine need different proxy routes.
In my setup, OpenCode needs a dedicated proxy entrypoint, while other tools use another proxy. Using global
environment variables affects unrelated tools, and using shell wrapper scripts is awkward for Windows, desktop app,
IDE, and corporate VPN setups.
I would like OpenCode to support explicit proxy configuration in opencode.json / opencode.jsonc, for example:
{
"$schema": "https://opencode.ai/config.json",
"network": {
"proxy": {
"http": "http://127.0.0.1:7890",
"https": "http://127.0.0.1:7890",
"all": "socks5://127.0.0.1:7890",
"noProxy": ["localhost", "127.0.0.1", "::1"]
}
}
}
Expected behavior:
- Keep existing environment variable support.
- Define clear precedence between config-based proxy settings and proxy environment variables.
- Apply the resolved proxy settings consistently to provider requests, plugin installs, MCP/network requests, and
other OpenCode-managed HTTP clients.
- Show resolved proxy settings in opencode debug config, with credentials redacted.
- Support existing config variable substitution, so credentials can be kept in env vars or files instead of hardcoded.
This would make OpenCode easier to use in enterprise/VPN environments and would avoid relying on global environment
variables or per-shell wrapper scripts.
Related but different issue: #21098 reports a plugin install failure when proxy environment variables are present.
This request is about adding first-class, scoped proxy configuration in OpenCode config.Reacted by Matthew Kern, Григорий Алексанян, nkabargin2gis, Alberto Camporredondo, Jeff K, chrischarland, erikdemarco, Igor Chakrygin, Zverev Konstantin, askazakov and 1 more
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Apr 29, 2026
This issue might be a duplicate of existing issues. Please check:
If your request is distinct from these (e.g., scoped specifically to config-file-based proxy with per-tool precedence), please clarify the difference so maintainers can evaluate accordingly.
github-actions commentedon Jul 5, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
erikdemarco commentedon Oct 18, 2026
No update?
rekram1-node commentedon Oct 18, 2026
not a bad idea, ill take a look
opencodejr commentedon Oct 29, 2026
Thanks for the detailed request! To summarize: you'd like proxy settings (
http/https/all, including socks5, andnoProxy) to be configurable inopencode.json, with clear precedence over theHTTP(S)_PROXY/NO_PROXYenvironment variables, applied to every outbound request OpenCode makes, and shown with credentials redacted inopencode debug config. That would let you scope a proxy to OpenCode alone instead of setting global env vars or using wrapper scripts.Right now OpenCode only reads the standard proxy environment variables (see the network docs), so this is a new feature. Maintainers will consider it.
Related issues:
opencode.jsonitsarunkj commentedon Oct 29, 2026
Looking forward to this @rekram1-node !
mosinnik commentedon Nov 13, 2026
@rekram1-node any news? I need proxy settings
rodi4eg commentedon Nov 18, 2026
Would be useful to have proxy at the provider level, the way
settings.tlsalready scopes a client certificate to one provider's requests only.Env vars can't express this. They apply to the whole process, so my own tools, webfetch and remote MCP servers get routed too, and a long-lived
serve --servicekeeps whatever environment it started with. A provider-levelproxy(http/https/socks5, winning over env for that provider only, userinfo redacted inopencode debug config) would let one provider use a tunnel while everything else connects directly.