leizhiyuan/rexpocket
Über uns
Android client for Rex, the terminal multiplexer: see every host, session and tab, and open any pane as a full-screen terminal (Ghostty emulator). Made for driving AI coding agents - pi, Claude Code, Codex, Gemini - from your phone, over LAN or a built-in Tailscale node. Rex 的 Android 手机终端客户端。
EntwicklerwerkzeugeWhat you can do
- Every host, session and tab on one screen. Each tab shows what runs in it - pi, Claude, Codex, an editor, or a shell - with its own mark and the title its program set, and a blue dot while a program in it is working or waiting for you.
- A real terminal. The pane is drawn by Ghostty's emulator from Rex's own stream: a snapshot of the whole terminal first, then its output as it comes. Colours, scrollback and full-screen programs are exactly as on the desk.
- Links. Long-press a link a program printed, or one it set as a hyperlink, to open, copy or share it.
- Files and images. Pick any file on the phone and send it to the pane you are looking at. Rex stores it on the computer and types its path itself, so a screenshot can go straight into an agent's prompt.
Gemessener Sternzuwachs
- in 24h
- +4
- in 7 days
- +18
- in 15 days
- +46
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalRexPocket
An Android client for Rex, the terminal multiplexer. It shows every session on your own Rex servers, down to the tab, and opens any pane as a full-screen terminal you type into directly. It talks to your Rex and nothing else - on the local network, over your tailnet through a Tailscale node built into the app, or through the computer's own SSH daemon.
| Home | Terminal | Terminal at night |
|---|---|---|
![]() |
![]() |
![]() |
On a tablet or in a desktop window the list stays beside the open pane - a session or a tab is switched without leaving the terminal it was showing, and the dock is one hand's reach wide.
| Tablet: the list beside the pane | Tablet: a sheet at the platform's width |
|---|---|
![]() |
![]() |
| Settings | Themes | Tabs |
|---|---|---|
![]() |
![]() |
![]() |
Settings is a page per subject with a search field under the list; themes are six terminal palettes, each shown with the colours it brings; the tabs of a session open as a grid of preview cards.
| Switching panes: where that pane sits in its tab |
|---|
![]() |
Both splits look alike on a phone that shows one pane at a time. For a moment after a switch the tab's layout is drawn in the corner, to scale, the pane on screen filled - taken from the layout tree Rex sends with the window, so a pane that spans two rows is drawn that way.
Features
- Every host, session and tab on one screen. Each tab shows what runs in it - pi, Claude, Codex, an editor, or a shell - with its own mark and the title its program set, and a blue dot while a program in it is working or waiting for you.
- A real terminal. The pane is drawn by Ghostty's emulator from Rex's own stream: a snapshot of the whole terminal first, then its output as it comes. Colours, scrollback and full-screen programs are exactly as on the desk.
- Made for the phone. Typing goes straight into the pane. A floating dock holds the keyboard,
Return and a key row:
esc,C-c, arrows that repeat while held, Tab, Return,ctrl, paste, a paperclip and/. Settings → Terminal can show optionalShiftandAltkeys; both are hidden by default. HoldctrlforC-cC-dC-zC-rC-lC-aC-eC-wC-j. A split shows one pane at a time, with a bar to move between them, and for a moment after a switch a small map of where that pane sits in the tab. The keyboard never resizes the terminal - the pane slides up under it only as far as needed to keep its lowest row of content in view, so a prompt near the top stays put and a program in it is never redrawn for the keyboard coming or going - and a keyboard on the desk takes the dock away, since it has every key on it. Paste and attach stay in the menu. - Links. Long-press a link a program printed, or one it set as a hyperlink, to open, copy or share it.
- Files and images. Pick any file on the phone and send it to the pane you are looking at. Rex stores it on the computer and types its path itself, so a screenshot can go straight into an agent's prompt.
- Themes. Six terminal palettes - Auto, Merino Light, Slate Dark, Pure Black, Solarized Light and Tokyo Night - in Settings → Themes, each listed with the background and cursor it brings. Auto follows the design mode, so the pane turns with the rest of the app.
- A tab grid. The tabs of a session open as a grid of cards: the program in front, the working directory, a line per pane with its programme and status, and what the tab is waiting for. A card at the end adds a tab, a long press opens the tab's own actions, and a long press on a pane in the bar opens that pane's.
- Background alerts. Optional: the app stays connected while it is away and notifies you when a program waits for approval, an answer or a login, or fails. Tap the alert to open that pane.
- Works beside the desk. The phone holds only the pane it shows and sizes it to the phone; the desktop keeps its own tab. Release hands a pane back to the desk until you Take over.
- Your tailnet, without the Tailscale app. The app runs its own Tailscale node, so a host is
reachable by its MagicDNS name or
100.xaddress without taking the phone's VPN slot. - Hosts over SSH. Add
ssh://hostand sign in with an account and a password or a private key; the app reaches Rex through the SSH daemon the machine already runs - no Rex port has to be open. The host key is shown and pinned on the first connection; a changed one stops the connection until you confirm it. A tailnet address is still dialed through the built-in node. - Knows when it is old. Once a day, and whenever Settings › About is tapped, the app asks its GitHub releases whether a newer build exists and says so; nothing is downloaded until you ask, and Android asks once for permission to install it. The update channel says what counts as newer: Stable takes finished releases only, Preview takes the newest published, alphas and betas included. A build that has never chosen follows what it came from.
- Light and dark. Follow the phone by default, or choose Light or Dark in Settings → Design. The interface is available in English, Simplified Chinese and Traditional Chinese.
Set up the computer
Rex has to be reachable from the phone: over the local network, over a tailnet, or through SSH.
On the local network. Start Rex with a plaintext port:
rex server start --extra-listen :7297 --allow-anonymous
Anyone who can reach that port has full access to that Rex, so open it only on a network you trust.
Over a tailnet. Turn on Rex's built-in Tailscale on the computer; it serves Rex over HTTPS at its MagicDNS name. Nothing has to be opened on the router.
Over SSH. Install Rex on the computer, as rex server install does, so a non-interactive
login can run rex (the app also looks in ~/.local/bin). Nothing has to be opened: the app
reaches the server through the machine's own SSH daemon. How the transport works is described in
docs/design/ssh-hosts.md.
Use the app
Add a host. The Add host row under the list, or Settings › Remote hosts. A name and an address is all it takes:
192.0.2.10- plaintext on port 7297192.0.2.10:7300- another portmy-mac.tail1234.ts.netor a100.xaddress - through Tailscale, on 443 with TLSssh://192.0.2.10orssh://my-mac.tail1234.ts.net- through that machine's SSH daemon; type the account and a password or a private key, and the first connection asks you to confirm its host key
The line under the field shows how the app will connect.
For a tailnet host, join the tailnet. Settings › General › Tailscale, give the phone a node name and save. The app opens the sign-in page once; after that the node starts with the app.
Open a tab. Tap a tab on the home screen. The plus beside a session makes a new tab; the host's menu starts a new session.
In the terminal:
- Tap the pane to type. Drag to scroll back, pinch to change the font size, long-press to select, or long-press a link to open it.
- Scroll the wide pill to reach more keys. Tap a modifier for the next key, twice quickly to
lock it, and once again to release it. Hold Return for Shift+Enter. Hold
ctrland slide to a chord. Locked Shift applies to all repeated arrows; one-shot Shift applies only to the first. - The tabs button in the header opens the session's tab grid; the session name opens the list of sessions.
- Swipe left or right, or use the bar under the pane, to move between the panes of a split.
- The menu holds Send a file, Paste, Split below, Rename session and End session. The
+beside the pane bar splits the pane you are on to its right; a long press on a pane pill renames or closes that pane.
On the home screen, the eye keeps only the tabs with a program working or waiting, and search filters hosts, sessions and tabs.
Background alerts: Settings › General › Background alerts, and allow notifications. A quiet notification shows while the app watches; its Stop turns alerts off. The app does not start on its own after a reboot, and Android's battery saving can delay an alert.
Reporting a problem
The app keeps the last few hours of its own log on the phone, so a problem can be reported after it happened.
- Settings › Developer. The line says
Offwhile the app only keeps its last few hours, andRecordingwhile a recording runs. - If the problem already happened, tap Share report and attach the file to an issue. If it only shows up while you use the app, tap Start recording, reproduce it, then come back and tap Stop and share.
- Review report shows the end of the report as it will be sent, so you can read it first.
- Open an issue copies the same report and opens the issue page: paste it, say what you were doing, and attach the file if you shared one.
The report holds the app version, the phone, your hosts, what the connection did, and the app's own
log - the last few hours, and a recording too if you made one. Addresses and host names become
<hidden>; tab titles, what a pane printed and what you typed are never in it. It is plain text, so
you can read it before you send it.
How it works
- Control. One WebSocket to
/api/control(rex.control.v1). The app subscribes to Rex's events, so a session's tabs, each program's status, its title and the shell's directory arrive as they change; nothing is polled. Calls run side by side; typed input has its own queue, so keys reach the program in the order they were pressed. - The pane. A second WebSocket to
/api/data(rex.data.terminal.v1) carries aGHOSTSNPsnapshot of the terminal, then its output. A dropped stream resumes from the last byte; an idle pane costs no traffic. - Ownership. The phone owns only the pane on its screen, with
session.own_block, so Rex applies the phone's size to it. Moving between tabs and panes is local to the phone: Rex's active tab stays the desktop's. When the desktop takes the shown pane, the phone takes it back, waiting longer each time the desk insists. A released pane stays the desk's until Take over. - SSH. Each HTTP or WebSocket connection is an SSH exec channel running
rex __internal dial-stdio, which joins its input and output to Rex's own Unix socket on that machine. The app pins the host key it saw, compares it on every connection, and a changed key stops retrying until you confirm the new one. The host is dialed directly, or through the built-in Tailscale node when its address is on the tailnet. - Tailscale. The node is the official
tailscale.com/tsnetlibrary running in userspace, with a SOCKS5 proxy on loopback in front of it; only the app's own connections use it. The node's UDP is bound to the phone's Wi-Fi or mobile network, around a proxy VPN such as Clash when the VPN allows apps to bypass it, so a direct path can form. The home screen shows the path to each tailnet host - direct, peer relay or DERP - with its round trip; tap it to measure again.
A faster tailnet path
From mobile data to a computer behind a home router, Tailscale often falls back to a DERP relay abroad, and every round trip costs a few hundred milliseconds. Either make the computer reachable (UPnP or NAT-PMP on the router, or a port forward for its Tailscale UDP port), or run your own DERP server or peer relay close to you and add it to the tailnet. The app follows without a change.
Build
Requires JDK 17, the Android SDK (platform 36) with an NDK, and python3 with curl.
./gradlew :core:test :app:assembleDebug
Every push to master and every pull request runs
.github/workflows/ci.yml: the unit tests, lint, a debug build, the
16 KB alignment check and the Go tests in tailnet/.
The APK lands in app/build/outputs/apk/debug/; :app:assembleRelease builds one signed with the
release key (see Releasing below). Builds are arm64-v8a only. The terminal is the official libghostty-vt, built from the
Ghostty revision pinned in native/ghostty/source.json by
tools/build-ghostty.py, which Gradle runs; the first build downloads Zig
and the Ghostty source, checked against their pinned checksums. To move to a newer Ghostty, change
the revision and checksum there. app/libs/tailnet.aar - the Go module in tailnet/, around
tailscale.com at the version its go.mod pins - is checked in; to build it again, run
tools/build-tailnet.sh. The integration
tests in core run against a Rex on 127.0.0.1:7297 (set REX_TEST_HOST / REX_TEST_PORT) and
are skipped without one. The SSH test runs only when REX_SSH_HOST and REX_SSH_USER name a
machine and REX_SSH_KEY or REX_SSH_PASSWORD gives a credential; REX_SSH_PORT,
REX_SSH_HOST_KEY, REX_SSH_KEY_PASSPHRASE and REX_SSH_SOCKS are optional.
Releasing
The app updates itself from its GitHub releases, and Android only installs an update signed by the same key as the installed app. So every release is signed with one key, whatever computer builds it; a release signed with another key cannot be installed over the last, only after uninstalling, which erases the app's hosts and tailnet login.
- Tell Gradle where the release key is, in the untracked
local.properties(or as Gradle properties or environment variables). A relative path is from the project root:REXPOCKET_KEYSTORE=release.keystore REXPOCKET_KEYSTORE_PASSWORD=... REXPOCKET_KEY_ALIAS=... REXPOCKET_KEY_PASSWORD=... - Raise
versionCodeandversionNameinapp/build.gradle.kts, and commit it asbuild: release <version>. - Push the tag:
git tag v<version> && git push origin v<version>. TheReleaseworkflow builds and signs the APK on GitHub and publishes the GitHub release withRexPocket-<version>.apkattached; the release notes are the body of the release commit. A version with a pre-release part (-alpha1,-beta2,-rc1) is marked a pre-release, which is what keeps an installed finished build away from it. Do not replace the APK of a published release - a new fix is a new version, and the workflow stops when the tag already has a release; a manual run withreplaceset is the only way past that. - The workflow takes the key from the repository secrets, set once in Settings → Secrets and
variables → Actions:
REXPOCKET_KEYSTORE_BASE64(the keystore file, base64-encoded),REXPOCKET_KEYSTORE_PASSWORD,REXPOCKET_KEY_ALIASandREXPOCKET_KEY_PASSWORD, plus aREXPOCKET_CERT_SHA256variable holding the certificate's SHA-256. It refuses a tag that disagrees withversionName, and refuses to publish an APK whose certificate differs from that digest, so a release cannot go out with a key that will not install over the last one. Building a release on your own computer still works as in step 1.
Acknowledgements
- Rex, by Superlogical - the multiplexer, its API and its session model.
- Ghostty, by Mitchell Hashimoto and contributors, MIT - the terminal
emulator: the app builds its official libghostty-vt library, license in
app/src/main/assets/licenses/Ghostty-MIT.txt. - Tailscale, by Tailscale Inc. and contributors, BSD-3-Clause - the tsnet library the app's Tailscale node is.
- JSch, by JCraft, Inc. and contributors, Revised BSD - the SSH client. eddsa, by Str4d and contributors, CC0 - the Ed25519 implementation Android's own security providers do not give JSch.
- Material Symbols (Rounded), by Google, Apache License 2.0 - the interface icons. The program marks are the app's own drawings, not the products' logos.
Ähnliche Projekte entdecken
Wird geladen…








