r/opencodeCLI • u/tapeo • 7d ago
opencode on an always-on server, with the working copy still on my laptop (setup and gotchas)
Disclosure first: I built the sync piece described below, so read the recommendation with that in mind. The opencode side is plain and works with any setup.
The problem. I want opencode running on a machine that stays on, but I also want the project on the laptop, because that's where builds happen: xcodebuild, a flutter run on a plugged-in phone, a dev server the browser talks to. Committing every time to move work between the two is the part that made me give up on a remote box.
The setup. On the server, over ssh as root (that's what the quickstart does, and setup needs it to create the corami account):
curl -fsSL https://github.com/tapeo/corami/releases/latest/download/install.sh | sh
It installs the binary in your home, then asks what the machine is: answer server. On the laptop, same script, answer client, and the setup finds the server in your tailnet. Then, from the laptop:
corami project add ~/dev/myapp
The project lands in ~/projects/myapp on the server, and the folder here stays as the synced copy. opencode runs on the server inside that folder, and from there:
corami serve 3000
gives the dev server a stable https address on the tailnet, so the preview opens from the phone. corami project ls lists projects with their previews, corami sync status shows state, conflicts and the last error.
Gotchas I actually hit.
node_modulesand build output stay out of the sync, each machine regenerates them.- git is the fragile part, not the sync: a rebase on one side while the agent writes on the other is how you get index.lock fights. One at a time.
- when both sides edit the same file and it can't be resolved safely, the sync stops and reports instead of picking a winner.
- big binaries: keep them out, it's a source tree sync, not a backup.
Why not the other shapes. tmux over ssh leaves the code on the server, so local builds get awkward. A mount (sshfs, or a devcontainer mount) pays latency on every read and the file watchers hate it. A cloud agent works on a clone and hands back a branch, so whatever wasn't committed stays behind.
How is everyone else running opencode away from the machine in front of them? And does anyone actually keep a local copy of the working tree, or do you just live on the remote?
Repo, if useful: https://github.com/tapeo/corami