npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lemantorus/opencode-tunnel

v1.0.0

Published

Beautiful TUI for managing OpenCode web server with tunneling

Readme

OpenCode Tunnel

License: MIT Platform Mobile

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.

Features

  • 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

Architecture

┌──────────────────┐      ┌──────────────┐      ┌─────────────────────┐
│   OpenCode       │      │   Proxy      │      │   Cloudflare        │
│   Server         │─────▶│   (SSE)      │─────▶│   Quick Tunnel      │
│   Port: 33333    │      │   Port: 33334│      │   .trycloudflare.com│
└──────────────────┘      └──────────────┘      └─────────────────────┘
                                                         │
                         ┌───────────────────────────────┘
                         │
                         ▼
              ┌──────────────────────┐
              │   OpenCode Mobile    │
              │   ┌──────────────┐   │
              │   │  QR Scanner  │   │
              │   │  Voice Input │   │
              │   │  WebView     │   │
              │   └──────────────┘   │
              └──────────────────────┘

How it works:

  1. OpenCode Server starts on port 33333
  2. Proxy starts on port 33334 and proxies requests + SSE events
  3. Cloudflare Tunnel creates a public HTTPS URL
  4. Mobile app scans QR and connects
  5. Voice messages are transcribed via Groq Whisper

Screenshots

TUI Interface

| Initial State | Port Configuration | |:-------------:|:------------------:| | Disabled | Ports |

| Configuration | Tunnel Running | |:-------------:|:--------------:| | Config | Running |

| QR Code for Mobile | |:------------------:| | QR |

Mobile App

| QR Scanner & Connections | Chats in App | |:------------------------:|:------------:| | Mobile | Chats |

Requirements

| Component | Version | Installation | |-----------|---------|--------------| | Node.js | 18+ | nodejs.org | | OpenCode | latest | npm i -g opencode-ai | | cloudflared | latest | See below |

Installing cloudflared

macOS (Homebrew):

brew install cloudflared

Linux (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-bin

Windows (PowerShell):

winget install Cloudflare.cloudflared

Windows (Manual):

  1. Download from GitHub Releases
  2. Extract cloudflared.exe to a folder in PATH

Installation

From Source

# 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 start

Global Installation (Optional)

npm link
opencode-tunnel

Usage

Starting

npm start

On first run, TUI automatically:

  1. Starts OpenCode Server on port 33333
  2. Starts Proxy on port 33334
  3. Creates Cloudflare Quick Tunnel
  4. Shows QR code for mobile

Keyboard Controls

| 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 |

Configuration Screen (C)

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

Changing Ports (L)

Defaults:

  • Server Port: 33333
  • Proxy Port: 33334

You can change them if ports are occupied.

Mobile App

Download

Download the latest version from GitHub Releases:

| Platform | File | |----------|------| | Android | opencode-mobile-{version}.apk | | iOS | opencode-mobile-{version}.ipa |

Installing Android APK

  1. Download APK file
  2. Open on your device
  3. Allow installation from unknown sources if prompted
  4. Install

App Features

  • 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

How to Connect

  1. Launch TUI on your computer
  2. Wait for tunnel creation and QR display
  3. Open OpenCode Mobile
  4. Tap "Scan QR"
  5. Point camera at QR code
  6. Done! You're connected to OpenCode

Voice Input

Voice input uses Groq Whisper API for speech-to-text transcription.

Getting Groq Token

  1. Register at console.groq.com
  2. Go to API Keys
  3. Create a new key
  4. Copy the token

Configuration

  1. In TUI press C for configuration
  2. Paste Groq Token
  3. Press Enter to save

Usage

  1. Connect to server via mobile app
  2. A microphone button appears in the text input field
  3. Tap to start recording (button turns red)
  4. Speak
  5. Tap again to stop
  6. Text is automatically inserted into the input field

Named vs Quick Tunnel

Quick Tunnel (Default)

  • Free, no registration
  • Randomly generated URL: https://xxx-xxx-xxx.trycloudflare.com
  • URL changes on each reconnect
  • Suitable for temporary use

Named Tunnel

  • Stable URL: https://your-subdomain.yourdomain.com
  • Requires Cloudflare account
  • Configure once

Setting up Named Tunnel:

  1. Create a tunnel in Cloudflare Zero Trust
  2. Copy the tunnel token
  3. In TUI press C
  4. Paste Tunnel Token
  5. Paste Tunnel Hostname (your public URL)
  6. Save

Configuration File

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
}

Logs

When logging is enabled (enableLogs: true), log file location:

~/.opencode-tunnel/proxy.log

Contains:

  • Proxy requests
  • SSE events
  • Errors

Troubleshooting

"opencode not found"

npm i -g opencode-ai

"cloudflared not found"

Install cloudflared (see Installing cloudflared)

"Port already in use"

Change ports via L key or kill the process:

# Find process on port
lsof -i :33333
# Kill process
kill -9 <PID>

QR not scanning

  • Make sure tunnel is connected (status "connected")
  • Try increasing terminal window size
  • Check URL under QR code

Voice input not working

  • Check Groq Token in configuration
  • Ensure app has microphone access
  • Check internet connection

Tunnel not connecting

  • Check internet connection
  • Verify cloudflared is installed and accessible
  • For Named Tunnel: verify token

Development

# Install dependencies
npm install

# Development mode
npm run dev

# Build
npm run build

# Type check
npx tsc --noEmit

Mobile App Development

See opencode-mobile/README.md

cd opencode-mobile
npm install
npm start

Releasing

To create a new release:

  1. Update version in package.json and opencode-mobile/app.json
  2. Create and push a tag:
git tag v1.0.0
git push origin v1.0.0
  1. GitHub Actions will automatically build APK and upload to Releases

Required GitHub Secrets:

License

MIT