Mobile push notifications for OpenCode via Expo. Connect your phone to receive notifications when OpenCode generates responses, even when you're away from your computer.
- Added
updatecommand support:npx opencode-mobile update(with--checkmode) - Installer now supports automation-friendly flags:
--yes,--provider,--skip-update-check, and token/domain options - Added notification filtering controls via
npx opencode-mobile filters - Improved Cloudflare setup: official package repos on Linux, Homebrew flow on macOS, and winget support on Windows
- OpenCode CLI installed and configured
- Node.js or Bun runtime
- Mobile device with OpenCode Mobile app (or Expo Go)
npx opencode-mobile installWhat this does:
- Installs
opencode-mobile@latestplugin to your global OpenCode config - Creates the
/mobilecommand (available in all projects) - Sets up tunnel provider configuration for mobile connectivity
Expected output:
β
Updated ~/.config/opencode/opencode.json
plugin: ["opencode-mobile@latest"]
β
Created /mobile command at ~/.config/opencode/commands/mobile.md
π Setting up tunnel provider for mobile notifications...
π Installation complete!
Restart OpenCode (run `opencode`) to load the plugin.
Use `/mobile` in any project to access mobile features.
opencode attachOr start a new session:
opencode serveWhat you'll see:
[opencode-mobile] v1.3.10
[PushPlugin][Mobile] Entry loaded: index.ts
Connecting to OpenCode...
Connected! Session ID: abc123
>
Inside OpenCode, type:
/mobile
What you'll see:
> /mobile
βββββββββββββββββββ
β βββββββ ββββββ β
β β βββ β ββ ββ β
β β βββ β ββββββ β
β βββββββ ββββββ β
β βββββββ ββββββ β
βββββββββββββββββββ
https://your-tunnel-url.ngrok.io
- Install the OpenCode Mobile app (or use Expo Go)
- Open the app and look for the QR scanner
- Scan the QR code displayed in Step 3
- Done! Your device is now registered for push notifications
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β OpenCode ββββββββΆβ Tunnel ββββββββΆβ Mobile Device β
β Server β β (ngrok/etc) β β (Push Notify) β
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
- Tunnel: Creates a secure public URL that your phone can reach
- QR Code: Encodes the tunnel URL for easy scanning
- Push Token: Your phone registers its Expo push token with the plugin
- Notifications: OpenCode events trigger push notifications to your device
| Command | Description |
|---|---|
npx opencode-mobile install [options] |
Install plugin and /mobile command globally |
npx opencode-mobile update [--check] |
Check for updates or install the latest version |
npx opencode-mobile filters <status|enable|disable> |
Manage session notification filters |
/mobile |
Display QR code for mobile connection |
/mobile ExponentPushToken[xxx] |
Manually register a push token |
npx opencode-mobile qr <tunnels.json> |
Show QR from tunnel metadata JSON |
npx opencode-mobile-tunnel-setup [options] |
Configure tunnel provider interactively or non-interactively |
npx opencode-mobile audit |
Run endpoint audit |
npx opencode-mobile uninstall |
Remove plugin globally |
| Variable | Description | Default |
|---|---|---|
TUNNEL_PROVIDER |
Tunnel provider (auto, ngrok, cloudflare, localtunnel) |
auto |
OPENCODE_MOBILE_DEBUG |
Enable debug logging (1 to enable) |
disabled |
OPENCODE_PORT |
Local server port | 3000 |
The plugin automatically tries providers in this order:
- Cloudflare - Recommended, secure default
- ngrok - Popular tunnel service (requires auth token)
- Localtunnel - Simple, free tunnel option
# Non-interactive install using Cloudflare
npx opencode-mobile install --yes --provider cloudflare
# Skip update checks in CI
npx opencode-mobile install --yes --provider cloudflare --skip-update-check
# Non-interactive ngrok setup
npx opencode-mobile install --yes --provider ngrok --ngrok-authtoken YOUR_TOKENFor the best experience with stable URLs:
# macOS
brew install ngrok
# Get your authtoken from https://dashboard.ngrok.com
ngrok config add-authtoken YOUR_TOKENProblem: Tunnel failed to start
Solutions:
# Check tunnel provider is installed
command -v ngrok
command -v cloudflared
# Run tunnel setup manually
npx opencode-mobile-tunnel-setup
# Or skip tunnel setup during install
npx opencode-mobile install --skip-tunnel-setupProblem: Device can't reach the plugin server
Solutions:
- Ensure your phone and computer are on the same network (for LAN mode)
- Check that the tunnel URL is accessible from your phone's browser
- Verify the QR code scanned correctly (compare the URL)
Problem: OpenCode doesn't recognize the plugin
Solutions:
# Verify installation
npx opencode-mobile --help
# Check global config
cat ~/.config/opencode/opencode.json
# Reinstall
npx opencode-mobile uninstall --yes
npx opencode-mobile install# Uninstall plugin
npx opencode-mobile uninstall --yes
# Clear stored tokens
rm ~/.config/opencode/mobile-tokens.json
# Reinstall
npx opencode-mobile installopencode-mobile/
βββ index.ts # Main plugin entry point
βββ src/
β βββ tunnel/ # Tunnel providers (ngrok, cloudflare, localtunnel)
β βββ push/ # Push notification logic
β βββ cli/ # CLI commands (install, qr, audit, etc.)
βββ bin/ # CLI entry points
βββ dist/ # Compiled output
βββ package.json
See AGENTS.md for development guidelines and project structure.
MIT License - see LICENSE file for details.