Remote control
A hipmmcode session running on your computer can be carried on from your phone: live replies, permission approvals, answers to questions, images and PDFs, file browsing, a terminal. What you send from the phone and what you type in the computer's terminal go into the same session.
| Way | Command | How the phone connects | Good for |
|---|---|---|---|
| Direct | /remote-control-local (/rcl) | HM Bot on the phone connects to this computer over SSH; no relay server in between | The phone can reach the computer (same LAN, Tailscale and the like) |
| Through the platform | /remote-control (/rc) | Through the platform relay, with the HiPMMCode phone app | Phone and computer on different networks; needs hipmmcode login first |
Connecting a phone with /rcl
- Type
/rclin hipmmcode. The first time it explains what it does; after you confirm, a QR code appears. - Open HM Bot on the phone and scan it. The code carries this computer's LAN address, SSH port and user, its host key fingerprint, and the session.
- The first connection asks once for the computer's login password. HM Bot then makes a key for this phone, adds it to
~/.ssh/authorized_keys, and deletes the password it held; from then on it logs in with the key. - Once connected, the corner above the input shows
/rcl · <phone name>.
The address in the code prefers a LAN interface (a private address on en*, eth*, wl*), then a Tailscale-style 100.64.0.0/10 address, then a public one. A VPN app's virtual interface address (198.18.0.0/15), loopback and link-local addresses are never used.
Security
Once the key is installed you can turn off PasswordAuthentication in sshd_config, and keep port 22 off the public internet. To lock a phone out for good, revoke its key in /rcs.
What the phone can do
- Live conversation — replies appear as they are written; messages typed in the computer's terminal show up on the phone too, marked "电脑终端" (computer terminal).
- What came before — a new remote session first syncs the conversation so far (the latest 400 messages), so turning on
/rclmidway still shows what was said. - Permissions and questions — permission prompts, questions and plan approvals appear on both sides; whichever answers first wins.
- Images and PDFs — sent as attachments to the turn.
@completes files in the session folder. - Slash commands — usage, status, context and the like come back to the phone as text; commands that only make sense in the computer's terminal say why, instead of opening a panel there.
- Changes and files — view uncommitted changes (diff), browse and open files in the session folder (sensitive ones such as
~/.sshare refused). - Terminal — open this computer's terminal on the phone. It shows the same colours as on the computer (24-bit).
- New sessions, saved conversations — the phone can start a session in a chosen folder or carry on a conversation saved on the computer. These run in tmux;
tmux attach -t hm-rc-xxxxxxxxtakes one over on the computer. A session started from the phone does not stop at the "trust this folder?" prompt.
Managing every session: /rcs
Type /rcs (/remote-control-sessions) in any hipmmcode terminal:
- The main list holds the sessions with remote control on: the way (
/rc,/rcl,phone), title, folder, phones connected and how long. Pick one to disconnect it (the session keeps running in its terminal), end a phone-started one (its tmux too), show the QR code, or disconnect a phone. - Terminals with it off wait behind "Terminals with Remote Control off (N)". Inside, just type to filter by title or folder, pick one, and choose "Turn on /rcl" or "Turn on /rc". That terminal connects by itself, without the first-run explanation; if it is in the middle of a reply, it connects once the turn ends.
- Long lists scroll with the cursor;
PageUp/PageDownpage through;Escclears the filter first, then goes back. - Further down: phones turned away (let one back in), phone keys (revoke one), turning remote control on or off for the whole computer, and stopping the local relay.
The same from the command line:
hipmmcode remote-control --list # sessions with it on + how many are off
hipmmcode remote-control --list --all # and every terminal with it off (with its pid)
hipmmcode remote-control --start 48213 # turn on /rcl in that terminal (--platform for /rc)
hipmmcode remote-control --disable # turn remote control off for the computer (--enable to undo)The terminal being turned on reads the request itself, so it must also run v1.3.1 or later.
Common problems
Scanning works but the phone cannot connect. Make sure phone and computer are on the same network, or both in Tailscale. The address in the code should be the computer's LAN address (such as 192.168.x.x); older hipmmcode versions could put a VPN's 198.18.0.1 there, which v1.3.1 no longer does.
The computer's terminal flashes. From v1.3.1, a phone connecting, disconnecting or reconnecting redraws only the corner, not the whole screen.
A phone message shows twice. Fixed in v1.3.1: hipmmcode sometimes puts recalled memories in front of a prompt, and older versions then took the phone's message for a new terminal message and sent it again.
Does it need a VPN? /rcl is only SSH between phone and computer, so no. Where the conversation itself goes depends on the channel; see Model channels.