Guide · Local and cloud modes
Direct egress or hybrid OpenCode?
Use direct mode when a local program only needs a cloud outbound address. Use hybrid mode when you want the normal OpenCode interface locally while agent work runs in a cloud workspace.
Direct mode: local program, cloud outbound address
Direct mode starts a temporary cloud worker and prints two local proxy addresses. Your program stays on your computer; its outbound network requests travel through the cloud worker.
python3 cloud-agents.py --local
- Use the printed SOCKS address with
ALL_PROXY. - Use the printed HTTP address with
HTTPS_PROXYwhen a program only supports an HTTP proxy. - Choose this mode for ordinary local tools that need cloud egress. It does not start an OpenCode agent.
Hybrid mode: local OpenCode, cloud agent
Hybrid mode starts OpenCode in a temporary cloud workspace, then opens the familiar OpenCode interface on your computer. Prompts, model work, normal tools, files, and agent state live in the cloud workspace while the session is active.
python3 cloud-agents.py hybrid --workdir "$PWD"
The local interface connects through the relay to the cloud OpenCode daemon. You use it normally: send a prompt, follow the live output, and receive the final response in the local interface.
Optional local commands in hybrid mode
Hybrid mode adds one explicit local-command tool. When the cloud agent requests it and permission is approved, the command runs in the local --workdir and its output returns to the cloud agent. Normal agent tools still run in the cloud.
Use this only when the agent truly needs a local file or command. It is not the default path for cloud work.
Which mode should I choose?
- Direct
- Keep an app local; give its outbound traffic a cloud address.
- Hybrid
- Use local OpenCode while the agent and workspace run in the cloud.
Connection model
Both modes use outbound connections from your computer and the temporary cloud worker to the Cloud Agents relay. They do not expose a public port on your computer or on the cloud OpenCode daemon.