Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
OpenCode's README mentions a client/server architecture that could "allow OpenCode to run on your computer while you drive it remotely from a mobile app." I'd love to see this happen with minimal setup for the end user.
The idea is simple: run something like opencode remote --public, get a QR code in the terminal, scan it with your phone, and you're connected to your OpenCode session from anywhere. No VPN, no tunnels, no port forwarding.
The approach I'm suggesting is WebRTC DataChannels for the actual P2P connection between the PC and the phone. WebRTC handles NAT traversal through STUN, so in most cases (~85% of network setups) traffic flows directly between devices without any relay. The only piece of infrastructure needed is a tiny signaling service to exchange the initial handshake (~2KB of data, deleted after a few seconds). This could be a Cloudflare Worker or similar, essentially free at any reasonable scale.
For reconnection when the phone switches networks (WiFi to cellular, etc.), WebRTC supports ICE restart — the phone re-negotiates through the signaling server and the P2P link comes back in a few seconds.
A few things I think would make this practical:
opencode remote for LAN-only mode (zero external dependencies, just a local WebSocket server)
opencode remote --public for P2P over the internet via a project-hosted signaling endpoint
opencode remote --public --signal=https://custom-url for users who want to self-host the signaling piece
There's already community interest around this. #18796 built QR + mobile access using Wireguard, #10549 asked for QR hooks in web mode, and #17421 is an ecosystem project doing LAN-only remote control. This proposal would cover the "works outside your home network without extra setup" gap.
I'd be happy to help with implementation or discuss the approach further.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
OpenCode's README mentions a client/server architecture that could "allow OpenCode to run on your computer while you drive it remotely from a mobile app." I'd love to see this happen with minimal setup for the end user.
The idea is simple: run something like
opencode remote --public, get a QR code in the terminal, scan it with your phone, and you're connected to your OpenCode session from anywhere. No VPN, no tunnels, no port forwarding.The approach I'm suggesting is WebRTC DataChannels for the actual P2P connection between the PC and the phone. WebRTC handles NAT traversal through STUN, so in most cases (~85% of network setups) traffic flows directly between devices without any relay. The only piece of infrastructure needed is a tiny signaling service to exchange the initial handshake (~2KB of data, deleted after a few seconds). This could be a Cloudflare Worker or similar, essentially free at any reasonable scale.
For reconnection when the phone switches networks (WiFi to cellular, etc.), WebRTC supports ICE restart — the phone re-negotiates through the signaling server and the P2P link comes back in a few seconds.
A few things I think would make this practical:
opencode remotefor LAN-only mode (zero external dependencies, just a local WebSocket server)opencode remote --publicfor P2P over the internet via a project-hosted signaling endpointopencode remote --public --signal=https://custom-urlfor users who want to self-host the signaling pieceThere's already community interest around this. #18796 built QR + mobile access using Wireguard, #10549 asked for QR hooks in web mode, and #17421 is an ecosystem project doing LAN-only remote control. This proposal would cover the "works outside your home network without extra setup" gap.
I'd be happy to help with implementation or discuss the approach further.