Terminal UI for managing OpenCode web server with Cloudflare tunneling. Get a public HTTPS URL to access OpenCode from anywhere, including mobile devices.
Note: This is an unofficial community project and is not affiliated with OpenCode or Anomaly.
- Terminal UI - Beautiful interface right in your terminal
- Cloudflare Quick Tunnel - Public URL without registration
- Named Tunnel - Stable URL for permanent use
- QR Code - Scan and connect from mobile
- SSE Proxy - Full Server-Sent Events support
- Voice Input - Dictate text via Groq Whisper API
- Cross-platform - macOS, Linux, Windows
- Mobile App - OpenCode Mobile for iOS and Android
┌──────────────────┐ ┌──────────────┐ ┌─────────────────────┐
│ OpenCode │ │ Proxy │ │ Cloudflare │
│ Server │─────▶│ (SSE) │─────▶│ Quick Tunnel │
│ Port: 33333 │ │ Port: 33334│ │ .trycloudflare.com│
└──────────────────┘ └──────────────┘ └─────────────────────┘
│
┌───────────────────────────────┘
│
▼
┌──────────────────────┐
│ OpenCode Mobile │
│ ┌──────────────┐ │
│ │ QR Scanner │ │
│ │ Voice Input │ │
│ │ WebView │ │
│ └──────────────┘ │
└──────────────────────┘
How it works:
- OpenCode Server starts on port 33333
- Proxy starts on port 33334 and proxies requests + SSE events
- Cloudflare Tunnel creates a public HTTPS URL
- Mobile app scans QR and connects
- Voice messages are transcribed via Groq Whisper
| Initial State | Port Configuration |
|---|---|
![]() |
![]() |
| Configuration | Tunnel Running |
|---|---|
![]() |
![]() |
| QR Code for Mobile |
|---|
![]() |
| QR Scanner & Connections | Chats in App |
|---|---|
![]() |
![]() |
| Component | Version | Installation |
|---|---|---|
| Node.js | 18+ | nodejs.org |
| OpenCode | latest | npm i -g opencode-ai |
| cloudflared | latest | See below |
macOS (Homebrew):
brew install cloudflaredLinux (Debian/Ubuntu):
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared
sudo chmod +x cloudflared
sudo mv cloudflared /usr/local/bin/Linux (Arch):
yay -S cloudflared-binWindows (PowerShell):
winget install Cloudflare.cloudflaredWindows (Manual):
- Download from GitHub Releases
- Extract
cloudflared.exeto a folder in PATH
npm install -g @lemantorus/opencode-tunnelThen run:
opencode-tunnel# Clone the repository
git clone https://github.com/lemantorus/opencode-tunnel.git
cd opencode-tunnel
# Install dependencies
npm install
# Build
npm run build
# Run
npm startIf installed globally via npm:
opencode-tunnelIf running from source:
npm startOn first run, TUI automatically:
- Starts OpenCode Server on port 33333
- Starts Proxy on port 33334
- Creates Cloudflare Quick Tunnel
- Shows QR code for mobile
| Key | Action |
|---|---|
S |
Start/stop OpenCode Server |
P |
Start/stop Proxy |
T |
Connect/disconnect Tunnel |
R |
Start/stop everything |
C |
Open configuration |
L |
Change ports |
Q |
Quit |
In configuration you can set:
- Tunnel Token - Token for Named Tunnel (optional)
- Tunnel Hostname - Named Tunnel URL (optional)
- Groq Token - Token for voice input (optional)
- Enable Logs - Logging to
~/.opencode-tunnel/proxy.log
Defaults:
- Server Port:
33333 - Proxy Port:
33334
You can change them if ports are occupied.
Download the latest version from GitHub Releases:
| Platform | File |
|---|---|
| Android | opencode-mobile-{version}.apk |
| iOS | opencode-mobile-{version}.ipa |
- Download APK file
- Open on your device
- Allow installation from unknown sources if prompted
- Install
- QR Scanner - Scan QR from TUI for quick connection
- Connection History - Saved servers with online indicator
- Voice Input - Microphone button for dictating messages
- Navigation - Back and home buttons for easy navigation
- Launch TUI on your computer
- Wait for tunnel creation and QR display
- Open OpenCode Mobile
- Tap "Scan QR"
- Point camera at QR code
- Done! You're connected to OpenCode
Voice input uses Groq Whisper API for speech-to-text transcription.
- Register at console.groq.com
- Go to API Keys
- Create a new key
- Copy the token
- In TUI press
Cfor configuration - Paste Groq Token
- Press
Enterto save
- Connect to server via mobile app
- A microphone button appears in the text input field
- Tap to start recording (button turns red)
- Speak
- Tap again to stop
- Text is automatically inserted into the input field
- Free, no registration
- Randomly generated URL:
https://xxx-xxx-xxx.trycloudflare.com - URL changes on each reconnect
- Suitable for temporary use
- Stable URL:
https://your-subdomain.yourdomain.com - Requires Cloudflare account
- Configure once
Setting up Named Tunnel:
- Create a tunnel in Cloudflare Zero Trust
- Copy the tunnel token
- In TUI press
C - Paste Tunnel Token
- Paste Tunnel Hostname (your public URL)
- Save
Configuration is stored in ~/.opencode-tunnel/config.json:
{
"tunnelToken": "your-cloudflare-tunnel-token",
"tunnelHostname": "https://your-subdomain.yourdomain.com",
"groqToken": "your-groq-api-key",
"serverPort": 33333,
"proxyPort": 33334,
"enableLogs": false
}When logging is enabled (enableLogs: true), log file location:
~/.opencode-tunnel/proxy.log
Contains:
- Proxy requests
- SSE events
- Errors
npm i -g opencode-aiInstall cloudflared (see Installing cloudflared)
Change ports via L key or kill the process:
# Find process on port
lsof -i :33333
# Kill process
kill -9 <PID>- Make sure tunnel is connected (status "connected")
- Try increasing terminal window size
- Check URL under QR code
- Check Groq Token in configuration
- Ensure app has microphone access
- Check internet connection
- Check internet connection
- Verify cloudflared is installed and accessible
- For Named Tunnel: verify token
# Install dependencies
npm install
# Development mode
npm run dev
# Build
npm run build
# Type check
npx tsc --noEmitcd opencode-mobile
npm install
npm startMIT







