opencode-server

Hosts OpenCode WebUI as a systemd user service with Tailscale HTTPS access.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/lechao365/AndroidSystemEnhance --skill opencode-server-lechao365
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencode-server
Source: https://github.com/lechao365/AndroidSystemEnhance/tree/main/harness/skills/cross-device/opencode-server
Command: npx skills add https://github.com/lechao365/AndroidSystemEnhance --skill opencode-server-lechao365

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Setting up remote access to an OpenCode WebUI running inside WSL2 requires manual systemd unit authoring, credential wiring, and Tailscale reverse-proxy configuration. This Skill automates that entire setup so a phone or remote browser on the same tailnet can reach the WebUI over HTTPS. ## Core Features & Use Cases - Systemd user service hosting: Generates or updates a systemd user unit (atomic write), cleans up legacy opencode web processes, starts the service, and waits for active state plus port readiness. - Tailscale serve configuration: Configures the Windows host's tailscale serve to proxy HTTPS traffic to localhost:PORT, then parses and reports the tailnet URL. - Status and partial modes: Supports --status-only checks and --restart-serve-only reconfiguration without restarting the WSL service. - Use Case: You are working in a cross-device emit/apply workflow and need a teammate's phone to open your OpenCode WebUI. Run the Skill to bring up the service, configure Tailscale, and receive the shareable HTTPS URL with the auth username. ## Quick Start Ask the assistant to start the OpenCode server so the WebUI is reachable from your phone over Tailscale.

Frequently Asked Questions about opencode-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose OpenCode WebUI to my phone over Tailscale?

Run the start script, which hosts opencode web as a systemd user service in WSL2 and configures tailscale serve on the Windows host to proxy HTTPS to localhost. It outputs the tailnet HTTPS URL and auth username for phone access.

How to run opencode web as a systemd user service in WSL2?

The script atomically writes a user unit with EnvironmentFile pointing to server.env, sets WorkingDirectory to the project root, enables and restarts the service, then waits until it is active and the port is listening.

What prerequisites are needed for Tailscale serve with WSL2?

You need WSL2 with systemd enabled, opencode-ai installed, iproute2 for port checks, powershell.exe interop, Tailscale installed and logged in on Windows, and a server.env file containing OPENCODE_SERVER_USERNAME and OPENCODE_SERVER_PASSWORD.

Why does the OpenCode service fail to become active?

Common causes include a missing server.env credential file, leftover opencode web processes that failed cleanup, or systemctl --user being unavailable. Check logs with journalctl --user -u opencode-web and rerun after fixing the environment.

Can I reconfigure Tailscale serve without restarting the service?

Yes, use the --restart-serve-only flag. It skips service stop and unit regeneration, only reconfiguring the Windows tailscale serve proxy and reporting the resulting URL.