Access and manage terminal sessions from anywhere — via web browser, mobile app, or Feishu bot. RTB runs on your server as a single binary with zero dependencies.
- Web Terminal — Full-featured terminal in the browser powered by xterm.js
- Mobile App — iOS/Android app with QR code scanning for instant connection
- Multi-Session — Create, switch, and manage multiple terminal sessions
- Remote Access — Built-in Cloudflare Tunnel support for secure public access
- Feishu Bot — Execute commands and receive notifications via Feishu/Lark
- Single Binary — Download one file, run it. No Node.js or dependencies needed
- Token Auth — Auto-generated token for secure access
- REST API — Integrate with your own tools and workflows
┌──────────────┐ WebSocket ┌─────────────────┐ node-pty ┌───────────┐
│ Web Panel │◄─────────────►│ │◄────────────►│ Shell / │
│ (xterm.js) │ │ RTB Server │ │ Process │
├──────────────┤ │ (Node.js) │ └───────────┘
│ Mobile App │◄─────────────►│ │
│ (Expo) │ │ HTTP + WS │
├──────────────┤ │ Port 3000 │
│ Feishu Bot │◄─ Long Conn ─►│ │
└──────────────┘ └────────┬────────┘
│
Cloudflare Tunnel
(optional)
Option 1: Pre-built binary (recommended)
Download from GitHub Releases — single file, no dependencies:
# macOS (Apple Silicon & Intel via Rosetta 2)
curl -fsSL https://github.com/codeweiz/remote-desktop-control/releases/latest/download/rtb-darwin-arm64.tar.gz | tar xz
# Linux x64
curl -fsSL https://github.com/codeweiz/remote-desktop-control/releases/latest/download/rtb-linux-x64.tar.gz | tar xz
# Linux ARM64 (Raspberry Pi, etc.)
curl -fsSL https://github.com/codeweiz/remote-desktop-control/releases/latest/download/rtb-linux-arm64.tar.gz | tar xzOption 2: Build from source (requires Node.js 22+)
git clone https://github.com/codeweiz/remote-desktop-control.git
cd remote-desktop-control
make install # install dependencies
make start # build and start# Basic start (manage sessions via web panel)
./rtb start
# Start with a specific command session
./rtb start claude
# Custom port
./rtb start --port 8080
# Enable Cloudflare Tunnel for public access
./rtb start --tunnelOn startup, RTB prints the access URL (with auth token) and a QR code:
Remote Terminal Bridge v2 started!
Web Panel: http://192.168.1.100:3000?token=xxx
Local: http://localhost:3000?token=xxx
Mobile: scan QR code to connect
██████████████████
██ QR Code here ██
██████████████████
- Web: Open the URL in any browser
- Mobile: Scan the QR code with the RTB app to auto-connect
Config is stored in ~/.rtb/config.json:
./rtb config # view current config
./rtb config set # interactive setupOverride with CLI flags or environment variables:
| CLI Flag | Env Variable | Description |
|---|---|---|
--port <port> |
- | HTTP port (default: 3000) |
--tunnel |
- | Enable Cloudflare Tunnel |
--feishu-app-id <id> |
FEISHU_APP_ID |
Feishu App ID |
--feishu-app-secret <s> |
FEISHU_APP_SECRET |
Feishu App Secret |
--feishu-chat-id <id> |
FEISHU_CHAT_ID |
Feishu Chat ID (optional) |
Priority: CLI flags > env variables > config file.
Quick tunnel (temporary domain, no setup):
./rtb start --tunnel
# Auto-assigns a xxx.trycloudflare.com domainNamed tunnel (fixed domain, requires setup):
cloudflared login
cloudflared tunnel create rtb
cloudflared tunnel route dns rtb rtb.your-domain.com
./rtb tunnel setup rtb rtb.your-domain.com
./rtb start --tunnelRTB includes an iOS/Android app built with Expo (React Native).
Connect: Scan the terminal QR code from the app's connect page. Manual address + token input is also supported.
Download: Android APK is available on GitHub Releases.
| Method | Path | Description |
|---|---|---|
| GET | /api/sessions |
List all sessions |
| POST | /api/sessions |
Create session {name, command, args} |
| DELETE | /api/sessions/:id |
Delete session |
| GET | /api/sessions/buffer?id= |
Get terminal output buffer |
| GET | /api/notifications |
Get notification settings |
| POST | /api/notifications |
Update notification settings |
| GET | /api/settings |
Get server settings |
- Node.js 22+
- npm
- Xcode (iOS) / Android Studio (Android) — for mobile dev only
src/ # Server TypeScript source
cli.ts # CLI entry point
server.ts # HTTP server + REST API
ws-server.ts # WebSocket server
session-manager.ts # Session lifecycle
pty-manager.ts # node-pty wrapper
feishu.ts # Feishu bot integration
tunnel.ts # Cloudflare Tunnel
notification.ts # Notification manager
auth.ts # Token auth
config.ts # Config file (~/.rtb/config.json)
web/ # Web terminal panel (single-file SPA)
mobile/ # Expo React Native mobile app
build-binary.mjs # Binary build script (esbuild + Node.js SEA)
make install # install dependencies
make dev # dev mode (tsx)
make build # compile TypeScript
make start # build and start
make start-tunnel # start with Cloudflare Tunnel
make start-claude # start with a claude session
make test # run tests (vitest)make mobile-install # install mobile dependencies
make mobile-start # start Expo dev server
make mobile-ios # run on iOS simulator
make mobile-android # run on Android emulatorUses Node.js SEA to package everything into a single executable:
make build-binary # outputs release/rtbPush a version tag to trigger automated builds for all platforms:
npm version patch # bump version
git push --follow-tags # triggers GitHub Actions release| Component | Technology |
|---|---|
| Server | Node.js, TypeScript, node-pty, ws |
| Web Panel | xterm.js (single-file SPA) |
| Mobile | Expo, React Native, WebView, expo-camera |
| Tunnel | Cloudflare Tunnel (cloudflared) |
| Messaging | Feishu/Lark SDK (long connection) |
| Testing | Vitest |
| Packaging | esbuild + Node.js SEA |
| CI/CD | GitHub Actions |
MIT