Loading articleโฆ
Loading 4weirdโฆ
Loading 4weirdโฆ
Loading articleโฆ
DocsOpenCode
Docs ยท desktop ยท opencode
The desktop app drives a user-installed OpenCode binary โ never a bundled copy. Pick cli mode (opencode run per fix) or server mode (long-lived opencode serve), then Export, Fix, or Heal from the desktop panel.
Requirements
The desktop app probes PATH for the binary and degrades gracefully when it is missing โ status line, Enable toggle, and Export/Fix/Heal all fall back to an install hint instead of crashing.
opencode binary for your OS (Windows: package manager or npm) and confirm opencode --version prints from a fresh shell.cli or server below. The status dot goes green when the bridge can reach the binary.Two modes
Both modes use your installed binary. CLI mode cold-boots per fix; server mode keeps one persistent process so fixes skip the cold boot.
cli (default)
opencode run per fix
Headless opencode run -f BUGFIX-<game>-<stamp>.md per fix. Simplest setup, nothing to keep alive โ best when you heal rarely.
server
opencode serve --port 4096
Long-lived sidecar (OPENCODE_MODE=server, OPENCODE_SERVER_URL=http://127.0.0.1:4096). Fixes skip the per-run boot โ best for tight Heal loops.
Worked example
A concrete pass through Export and Fix in cli mode: from a failing playtest to a reviewed diff, with every click and command named.
BUGFIX-<game>-<stamp>.md plus a JSON twin: repro steps, logs, and workspace paths the agent may touch.opencode run -f BUGFIX-<game>-<stamp>.md. The agent edits code inside the workspace root and prints the files it changed.Troubleshooting
Four common failure shapes, each with the fastest check first. All of them are local PATH or process issues, never account issues.
Binary not found after install
Close and re-open the desktop app so it re-reads PATH, then run opencode --version in a fresh shell. Package-manager shims often land on PATH only for new processes.
Server mode refuses to connect
Confirm opencode serve --port 4096 is still running and OPENCODE_SERVER_URL=http://127.0.0.1:4096 matches the port. A second serve on another port splits the brain: kill extras, keep one.
Fix edits files outside the game
Re-check the working-dir picker: runs must root at the game workspace. Re-export after picking the right folder, since the report snapshots the paths it may touch.
Run hangs with no output
Press stop, shorten the per-run timeout, and re-run with a smaller report. Streaming stdout and stderr should resume line by line; silence past the timeout means the process wedged, not that it is thinking.
Next steps