e9991cb61b80bd229866d19b91ccbc0c678cc862
* fix(connect): surface real connection error instead of generic dialog
testConnection swallowed the actual fetch error and returned a bare
boolean, so every failure collapsed to the same "Connection Failed"
text. On-device this made tailnet/LAN connect failures impossible to
diagnose (DNS vs timeout vs 401 vs cleartext all looked identical).
- testConnection now returns { ok, error } with the real error message
- add.tsx and [id].tsx dialogs show the error + target URL, plus a
Tailscale/MagicDNS hint
- IP field keyboard: decimal-pad -> url, so tailnet hostnames can be
typed (not just pasted)
Verified backend is healthy and reachable over tailnet (health 200,
port 4096 open in packet filter, cleartext present in shipped v0.2.0
APK), so the failure is client-side and was previously unobservable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(connect): normalize pasted IP/URL to avoid double scheme
Quick-connect blindly did `http://${ip}:${port}`. Pasting a full URL
(e.g. "http://100.108.64.76:4096", as the clipboard auto-paste offers)
produced "http://http://100.108.64.76:4096:4096" -> malformed URL ->
"Network request failed". This is the real tailnet connect failure:
typing a bare IP worked, pasting the displayed URL did not.
buildUrl now strips an existing http(s) scheme, drops any path, and
lifts a trailing :port out of the host field, so pasted full URLs,
host:port, and bare hosts all resolve to a single well-formed URL.
Reproduced and fixed on the Android emulator (paste full URL: fails
before, connects after).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OpenCode Mobile
A React Native / Expo app for connecting to OpenCode servers from your phone.
Features
- Multiple Connection Types: Connect via local network, tunnels (Cloudflare/ngrok), or cloud-hosted instances
- Secure Authentication: Biometric authentication (Face ID/Touch ID) support
- Session Management: View, create, and manage coding sessions
- Real-time Chat: Stream responses from your AI assistant
- File Diff Viewer: See what changes were made to your code
Getting Started
Prerequisites
- Node.js 18+
- Bun (recommended) or npm
- Expo Go app on your phone (for development)
Installation
# From the monorepo root
cd packages/mobile
bun install
# Start the development server
bun start
Connecting to OpenCode
-
Start OpenCode in server mode on your machine:
OPENCODE_SERVER_PASSWORD=yourpassword opencode serve --hostname 0.0.0.0 --port 4096 -
Open the app and add a connection:
- Local Network: Use your machine's local IP (e.g.,
http://192.168.1.100:4096) - Tunnel: Set up a Cloudflare Tunnel or ngrok and use the tunnel URL
- Cloud: Connect to a hosted OpenCode instance
- Local Network: Use your machine's local IP (e.g.,
Building for Production
iOS
bun run ios
# or
eas build --platform ios
Android
bun run android
# or
eas build --platform android
Security
- Credentials are stored securely using
expo-secure-store(iOS Keychain / Android Keystore) - Optional biometric authentication for app access
- Optional biometric confirmation for sending messages
- All traffic should use HTTPS for non-local connections
Architecture
packages/mobile/
├── app/ # Expo Router screens
│ ├── (tabs)/ # Tab navigation
│ ├── session/ # Session screens
│ └── connection/ # Connection management
├── src/
│ ├── components/ # Reusable components
│ ├── hooks/ # Custom hooks
│ ├── lib/ # SDK client & types
│ └── stores/ # Zustand state stores
└── assets/ # App icons & images
Contributing
This is part of the OpenCode monorepo. See the root README for contribution guidelines.
Description
Languages
TypeScript
49%
Python
20.5%
HTML
18.9%
JavaScript
8.8%
Kotlin
1.2%
Other
1.6%