A CLI tool to manage OpenCode as a background service with a web UI for configuration and Tailscale integration for remote access.
- π Web UI - Visual configuration panel for all settings
- π Password Protection - Secure your remote access with a password
- π± Tailscale Integration - Automatic detection of Tailscale IP for remote access
- β‘ Auto-start - Runs as a systemd user service, starts on login
- π Service Management - Start, stop, restart, and monitor the service
- π Status Dashboard - See all access URLs and service status at a glance
- π Logging - Service logs saved for debugging
git clone https://github.com/luigivis/opencode-remote.git
cd opencode-remote
bun install
bun run build
sudo ln -s "$(pwd)/dist/index.js" /usr/local/bin/opencode-remotebun install -g opencode-remote# Start the service
opencode-remote start
# Check status
opencode-remote status
# Open configuration UI
opencode-remote config
# Stop the service
opencode-remote stop
# Restart the service
opencode-remote restart
# Show help
opencode-remote help-
Start the service:
opencode-remote start
-
Open the configuration UI:
opencode-remote config
-
Set your password in the web UI at
http://localhost:4097 -
Enable auto-start (optional):
opencode-remote install-service
If you have Tailscale installed on both your computer and phone:
-
Ensure Tailscale is running on both devices and logged in with the same account
-
Start the service:
opencode-remote start
-
Get your Tailscale IP:
tailscale ip
-
From your phone, open the browser and go to:
http://<YOUR_TAILSCALE_IP>:4096 -
Enter your password when prompted
Configuration is stored at ~/.config/opencode-remote/config.json
Access the web UI at http://localhost:4097:
| Setting | Description | Default |
|---|---|---|
| OpenCode Web Port | Port for the OpenCode web interface | 4096 |
| Config UI Port | Port for the configuration UI | 4097 |
| Password | Access password (leave empty to disable) | - |
| Hostname | Network interface to bind to | 0.0.0.0 |
| Auto-start | Start service on login | true |
| Tailscale Only | Show only Tailscale IP in status | false |
You can also edit ~/.config/opencode-remote/config.json directly:
{
"port": 4097,
"opencodeWebPort": 4096,
"password": "your-secure-password",
"autoStart": true,
"hostname": "0.0.0.0",
"tailscaleOnly": false
}When the service is running:
| Access Type | URL |
|---|---|
| Local (Browser) | http://localhost:4096 |
| Config UI | http://localhost:4097 |
| Tailscale (Phone) | http://100.x.y.z:4096 |
| Local Network | http://192.168.x.x:4096 |
The tool can install itself as a systemd user service for automatic startup:
opencode-remote install-serviceopencode-remote uninstall-servicesystemctl --user start opencode-remote
systemctl --user stop opencode-remote
systemctl --user restart opencode-remote
systemctl --user status opencode-remoteService logs are stored at:
~/.local/share/opencode-remote/service.log
View logs:
tail -f ~/.local/share/opencode-remote/service.logβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β opencode-remote β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββ β
β β CLI β β Web UI β β Service β β
β β (Commands) β β (Config) β β (Systemd) β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββ β
β β β β β
β βββββββββββββββββββββΌββββββββββββββββββββ β
β β β
β ββββββββββββββββ΄βββββββββββββββ β
β β Config Store β β
β β ~/.config/opencode-remote/ β β
β βββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββΌββββββββββββββββββββ β
β β β β β
β ββββββββ΄ββββββββ βββββββββ΄ββββββββ ββββββββ΄βββββββ β
β β Tailscale β β opencode web β β Logs β β
β β Info β β Service β β β β
β ββββββββββββββββ βββββββββββββββββ βββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Variable | Description |
|---|---|
OPENCODE_SERVER_PASSWORD |
Password for OpenCode web (set via config UI) |
-
Check if OpenCode is installed:
which opencode
-
Check service logs:
tail -f ~/.local/share/opencode-remote/service.log -
Try starting manually:
opencode web --port 4096
-
Verify Tailscale is connected on both devices:
tailscale status
-
Check your Tailscale IP:
tailscale ip
-
Check if the port is accessible:
nc -zv 100.x.y.z 4096
Make sure you're using the same password you set in the config UI. The password is stored locally and not synced anywhere.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.
- GitHub: @luigivis