Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 894 Bytes

File metadata and controls

39 lines (26 loc) · 894 Bytes

OpenCode Serve

Running opencode serve persistently

Start it so it survives SSH disconnection (use a fixed port for easy reconnection):

nohup opencode serve --port 4096 > ~/.opencode-serve.log 2>&1 &

Connecting to a running server

From anywhere (same machine or remote via SSH tunnel):

opencode attach http://localhost:4096

If connecting from a different directory, specify which project to work on:

opencode attach http://localhost:4096 --dir /path/to/project

Management commands

  • Check status: pgrep -f "opencode serve"
  • View logs: tail -f ~/.opencode-serve.log
  • Stop it: pkill -f "opencode serve"

Remote access via SSH tunnel

If the server is on a remote machine, create an SSH tunnel:

ssh -L 4096:localhost:4096 user@remote-host
# Then in another terminal:
opencode attach http://localhost:4096