Xpropel/Pi-Remote
Tentang
Remote control for your pi coding agent. Pi-Remote mirrors live pi terminal sessions to any browser, so you can watch runs, answer prompts, and send commands from your phone — end-to-end encrypted over a self-hosted relay.
Alat pengembanganYang dapat Anda lakukan
- Real-Time Mirroring & Remote Input — Output, thinking, tool calls, diffs, and status changes sync live with incremental catch-up after disconnects. Queue or steer follow-up messages while pi is busy.
- Interactive Q&A & Approvals (ask_user) — Answer model questions (single-select with inline custom input while keeping all options visible, multi-select, confirmations, free text) and tool approval prompts directly from web or mobile, including live hot-reclamation of open local prompts.
- Line-range jump & highlight, Markdown Preview / Source toggle, animated file loading view, and one-click manual refresh.
- Zero persistent file storage on the relay: small referenced files (≤ 512 KB) are pre-uploaded asynchronously to a pure in-memory 5-minute TTL cache on the relay (never written to disk, automatically invalidated after write/edit, and disabled for E2EE rooms). Once expired (> 5 min), clicking immediately pulls the latest version from your machine (up to 5 MB).
Pertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- +5
- dalam 1 bulan
- +47
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asli
Pi-Remote
Multi-device remote control & real-time sync for the pi coding agent — across Web, Android, and iOS.
English | 简体中文
Pi-Remote attaches to a running pi session through pi's official extension API. It never modifies pi's source code and never hijacks your terminal. Your session stays in the local pi process on Windows, macOS, or Linux at all times, while your browser, Android app, or iPhone stays synced in real time — letting you read replies, inspect referenced files, answer model questions, switch models, run commands, and launch sessions across multiple machines.
Relationship to pi: Pi-Remote is a companion tool built for pi, Earendil's terminal coding agent, using pi's official extension API. It is not a fork, variant, or replacement of pi — pi continues running in your local terminal while Pi-Remote adds a remote mirror and control surface.
[!NOTE] Project Status Notice: Pi-Remote is under active, rapid development and still has many design flaws, rough edges, and potential bugs across its architecture, UI/UX, and multi-platform behavior. Everyone is warmly welcome to test it out, report issues via Issues, and submit Pull Requests to help optimize and improve it together!
Three-pane desktop workspace with inline diffs, clickable file links, and adaptive light/dark themes on the left; real-time mobile companion on the right.
Mobile Apps (Android & iOS)
Pi-Remote now ships with native Android and iOS Capacitor apps alongside the responsive Web UI — bringing live task status right to your phone's Dynamic Island, Lock Screen, and status bar.
Mobile companion views: live code diffs & file viewer, multi-host & remote controller hub, and unified Cloud Speech-to-Text providers.
Android App (android/)
- Live Updates & Fluid Cloud (Android 16 / API 36) — Live status capsule (
Working/Thinking/Running/Worked), 3-node task progress cards, live thinking preview, provider brand badges, and background keep-alive settings to prevent OS throttling. - Multi-Server Profiles & Deep Links — Save and switch between multiple relays (LAN, Cloudflare Tunnel, or self-hosted servers), with QR scanning and
pi-remote://deep links. - Native File Downloads — Files opened from model replies can be saved straight to
Download/Pi-Remote/via the built-inPiFileSaverPlugin.
iOS App (ios/)
- Dynamic Island & Lock Screen Live Activities — Powered by
ActivityKit+PiLiveActivityExtension(WidgetKit), showing real-time agent phase, active task progress, thinking snippet, and provider brand icon without unlocking or switching back to the app. - Native File Export & Keyboard Polish — Export remote files through the native iOS share sheet, plus WKWebView keyboard focus/resume polish and full iOS Safari PWA support.
- Zero CocoaPods & No Paid Developer Account Needed — Built with Capacitor 7 + SwiftPM (
ios/App/CapApp-SPM). Produces a clean unsigned.ipaready for SideStore, AltStore, Sideloadly, TrollStore, or direct deployment via Xcode with a free Apple ID.
Building Mobile Apps Locally (No Docker Required)
# Prerequisites: Node >= 22.18, UI dependencies installed
npm install
npm --prefix ui install
# Build Android APK (requires JDK 17/21 + Android SDK)
# Output: dist/Pi-Remote-v<version>-android-debug.apk (pass --release for release APK)
npm run build:android
# Build unsigned iOS IPA on macOS (requires Xcode; pass --simulator for iOS Simulator)
# Output: dist/Pi-Remote-v<version>-ios-unsigned.ipa
npm run build:ios
Core Features
- Real-Time Mirroring & Remote Input — Output, thinking, tool calls, diffs, and status changes sync live with incremental catch-up after disconnects. Queue or steer follow-up messages while pi is busy.
- Interactive Q&A & Approvals (
ask_user) — Answer model questions (single-select with inline custom input while keeping all options visible, multi-select, confirmations, free text) and tool approval prompts directly from web or mobile, including live hot-reclamation of open local prompts. - Remote File Viewer with 5-Minute Ephemeral Cache — Click Markdown links (
[label](path),file:///...#L10-L20), inline code paths with line ranges (bridge.ts:160-170), or bare file path mentions in model replies — including in archived / unloaded sessions:- Line-range jump & highlight, Markdown Preview / Source toggle, animated file loading view, and one-click manual refresh.
- Zero persistent file storage on the relay: small referenced files (≤ 512 KB) are pre-uploaded asynchronously to a pure in-memory 5-minute TTL cache on the relay (never written to disk, automatically invalidated after
write/edit, and disabled for E2EE rooms). Once expired (> 5 min), clicking immediately pulls the latest version from your machine (up to 5 MB).
- Smart Session, Model Picker & Official Context Presets — Existing sessions automatically resume with their last-used model and thinking level; new sessions use your configured default model. Cursor-style model picker shows context window + thinking level (
1M Max,128K High,Fast) with hover-only descriptions and an inline Edit panel (Context,Effort,Options); Settings › Models offers official catalog/family context-window & max-output presets. - Unified Cloud Speech-to-Text (STT) & Push-to-Talk — Relay exposes
/api/stt/{config,test,transcribe}(supporting binary WAV, JSON base64, and multipart upload) with0600masked key storage and pure in-memory audio forwarding. Built-in support for Alibaba Cloud DashScope (qwen3.8-omni-flash,qwen3-asr-flash), DeepSeek ASR (/tools/asr), and user-defined custom providers (openai_whisper,dashscope_chat_audio,deepseek_asr) managed in Settings › General › Voice Input, paired with universal 16kHz PCM WAV push-to-talk across Web, iOS, and Android. - Multi-Device, Remote Controllers & QR Join — Connect Windows, macOS, and Linux machines to one relay simultaneously. Settings › Devices is organized into two halves: Pi Hosts on top (
Add Devicepairing) and Remote Control Devices below (live online Web / Phone / Tablet controller counts and roster), with an Add Control Device QR share panel (one-scan join link, native App deep link, URL-only mode, copy link, and PNG export; automatically detects configuredPI_REMOTE_PUBLIC_URL, live--tunnelrandom domains, and LAN IPs). You can also run completely serverless viasetup --localornpm run relay:tunnel. - Interactive Shell & Scheduled Tasks — Built-in interactive PTY shell (including E2EE shell support), remote bash, session tree / fork / clone / compact, inbox notifications, and scheduled messages.
- 6 Languages & Adaptive Themes — Simplified Chinese, English, Japanese, Korean, French, and Spanish, with light / dark / system themes across desktop, tablet, and mobile.
How It Works
| Component | Location | Role |
|---|---|---|
| Sync extension | extension/src/ → extension/pi-remote-sync.ts |
Runs inside the local pi process. Streams session events, executes remote commands, handles interactive prompts, and pre-uploads referenced small files to the relay's 5-min ephemeral RAM cache |
| Device attach daemon | deploy/attach.cjs & deploy/lib/ |
Keeps the device reachable, launches new sessions on demand, manages session archives, and serves get_file for archived/unloaded sessions inside allowed directories |
| Relay server | relay/ |
Lightweight Node WebSocket relay handling auth, routing, device/session index, and a pure-RAM 5-minute ephemeral file cache (no model credentials, no persistent file storage) |
| Web UI | ui/ |
Cursor-style desktop, tablet, and mobile interface built with React + Vite |
| Mobile apps | android/ & ios/ |
Native Capacitor wrappers adding Android 16 Live Updates / Fluid Cloud, iOS Dynamic Island Live Activities, multi-server profiles, and native file export |
Full wire protocol details: readyUI/data-interface.md.
Quick Start
Prerequisite: Install pi first and verify it runs locally (Node >= 22.18):
npm install -g @earendil-works/pi-coding-agent
Run locally without a cloud server (with built-in temporary random domain + one-scan mobile QR code — no typing long tunnel URLs or tokens):
1. Initialize local config once (macOS / Linux / Windows):
npm install
node deploy/setup.cjs --local # generates relay/config.json (3 random tokens) + local .env (mode 0600)
2. Start local relay + attach window with automatic QR code:
# macOS / Linux:
deploy/sync-extension.sh # install extension into ~/.pi/agent/extensions/
deploy/attach.sh --tunnel # starts local relay + Cloudflare random tunnel + terminal & 127.0.0.1 QR page
# (LAN / same Wi-Fi only: deploy/attach.sh --qr)
deploy/start-pi.sh # in a second terminal: start pi
# Windows (PowerShell):
powershell -ExecutionPolicy Bypass -File deploy\sync-extension.ps1
deploy\attach.cmd --tunnel # or LAN only: deploy\attach.cmd --qr
deploy\start-pi.cmd # in a second terminal: start pi
3. Scan on your phone to join: Scan the terminal QR or the local 127.0.0.1 QR page using the Android / iOS app ("Scan QR") or your phone camera (supports both universal #t= one-scan join and pi-remote:// native app deep links). You can also run npm run relay:tunnel, npm run relay:qr, or node deploy/qr.cjs <any-temp-url> anytime (compatible with Cloudflare, ngrok, cpolar, frp, and local Docker).
For production server deployment (systemd, reverse proxy, token management, troubleshooting), see deploy/README.md or deploy/docker/README.md (including the Docker tunnel profile & QR join flow).
Security Model
- Separated credentials: Local extension channel (7001) and viewer channel (7002) use distinct tokens (plus optional Ed25519 device key auth & QR pairing). Secrets and
.envfiles are gitignored. - Strict path jail & ephemeral-only file relay:
get_fileis strictly confined to the session'scwd(blocking..traversal and symlink escapes). The relay's 5-minute file cache stays strictly in memory, is never written to disk, expires automatically after 5 minutes, and is completely bypassed for E2EE encrypted rooms. - Connection gating: A device is only reachable while its attach window / extension is running.
- Local shell toggles: Remote bash and interactive PTY shell can be disabled locally via
PI_REMOTE_ALLOW_BASH=0orPI_REMOTE_DISABLE_SHELL=1. - Single-user self-hosted design: Anyone holding your viewer token can interact with your sessions; always protect public access with a private network, Cloudflare Tunnel, or TLS reverse proxy.
Development & Verification
npm install
npm --prefix ui install
npm run build:extension # assemble extension/pi-remote-sync.ts from extension/src/*.ts
npm run check:extension # verify extension bundle is up to date
npm run check:js # static syntax & reference guard for relay/deploy/scripts
npm run check:tests # verify all test files are registered
npm run test:i18n # verify 6-language i18n parity
npm test # run full unit & protocol test suite
cd ui && npx tsc -b && npm run build
Contributing & Community
Pi-Remote is evolving rapidly — we warmly welcome everyone to help improve and optimize this project together!
Whether you use Pi-Remote daily on your desktop, test the new Android and iOS apps on different devices, or have ideas to make remote coding smoother, your contributions make a huge difference:
- Bug reports & device feedback: Open an Issue — feedback on Android Live Updates / Fluid Cloud across ROMs, iOS Dynamic Island / sideloading, network edge cases, and UX rough edges is especially valuable.
- Pull Requests welcome: Improvements to mobile native features, UI/UX polish, performance, security hardening, translations, or documentation are all appreciated.
- Before opening a PR: Please run
npm test,npm run check:extension,npm run check:js,npm run test:i18n, andcd ui && npx tsc -b && npm run build, and ensure no.env, tokens, private keys, or personal session files are included.
If you find Pi-Remote helpful, feel free to star the repo, share ideas in Issues/Discussions, or jump in with a PR — let's build the best remote companion for pi together!
Documentation
- Deployment & troubleshooting: deploy/README.md
- UI development: ui/README.md
- Sync protocol & command specs: readyUI/data-interface.md
- Terminal vs. remote capability inventory: readyUI/pi-interface-inventory.md
Credits
| Role | Contributor |
|---|---|
| Founder | Xpropel |
| UI design | Muse (Meta) |
| Code implementation | DeepSeek |
| Project planning | Claude, ChatGPT |
Star History
License
Jelajahi proyek terkait
Memuat…