Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | Turkish

opencode-serve-mobile-fix

Mobile-friendly wrapper for OpenCode serve.

It starts OpenCode, prints a LAN URL + QR code for your phone, and applies a narrow Windows session-history path fix without touching prompts, file contents, patches, or tool payloads.

Built for people who run OpenCode on a Windows PC and control it from a phone on the same network.


Why this exists

OpenCode already supports a client/server architecture. You can start a headless server and connect from a browser or another client.

On Windows, some Web UI session-history requests can miss existing sessions because the browser sends paths like:

C:/laragon/www/project

while saved OpenCode sessions may use:

C:\laragon\www\project

oc-fix runs as a tiny local proxy and normalizes only the affected directory query parameter for session-list requests.


Features

  • oc-fix serve starts opencode serve and a proxy in one command.
  • Prints a phone URL and terminal QR code.
  • Keeps OpenCode backend on 4096, proxy on 4097 by default.
  • Supports WebSocket/SSE traffic through http-proxy.
  • Fixes Windows session history path mismatch in a narrow, safe way.
  • Adds a small C:/laragon/www/ quick-fill button to the Open Project modal.
  • Does not modify the OpenCode database.
  • Does not patch OpenCode binaries.
  • Does not modify model prompts, code output, file contents, or request bodies.

Install

Windows

git clone https://github.com/fitzgpt/opencode-serve-mobile-fix.git
cd opencode-serve-mobile-fix
install.bat

Linux/macOS

git clone https://github.com/fitzgpt/opencode-serve-mobile-fix.git
cd opencode-serve-mobile-fix
chmod +x install.sh
./install.sh

Usage

oc-fix serve

Then scan the QR code or open the printed phone URL:

http://YOUR_PC_IP:4097

Custom ports

oc-fix --proxy-port 5001 serve --port 5000

This runs:

  • OpenCode backend: 127.0.0.1:5000
  • Mobile proxy: 0.0.0.0:5001

Security

OpenCode warns when OPENCODE_SERVER_PASSWORD is not set. For shared networks, set a password before starting:

$env:OPENCODE_SERVER_PASSWORD="your-strong-password"
oc-fix serve

Basic auth username defaults to opencode unless you set OPENCODE_SERVER_USERNAME.


What gets rewritten

Only this narrow case:

GET /session?directory=C:/...
GET /api/session?directory=C:/...

Only the directory query parameter is rewritten from / to \.

Everything else passes through untouched.


Not affiliated

This is a community utility. It is not built by, endorsed by, or affiliated with the OpenCode team.


License

MIT

About

Mobile-friendly OpenCode serve wrapper with Windows session path fix and QR access.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages