ccy.dev
/

gtmux / 指南guides / 手机与网页phone & web

用手机和网页远程管理与协作Manage and collaborate from your phone and the web

agent 一跑就是半小时,你没必要坐在电脑前陪着。这篇干两件事:把你自己的手机和浏览器配上 Mac,走到哪都能看、能回、能收推送;再把某一个会话临时开给协作者看,权限攥在你手里。 An agent run takes half an hour; you don’t have to sit there for it. This guide does two things: pair your own phone and browser to the Mac so you can watch, reply, and get pushed from anywhere — then open one session to a collaborator for a while, with the permissions staying in your hand.

1 · 在 Mac 上开门1 · Open the door on your Mac

gtmux serve                # same Wi-Fi
gtmux tunnel               # any network — a public URL over an outbound tunnel

同一个 Wi-Fi 用 serve 就够;出了门用 tunnel,不用开路由端口、不用 VPN。serve is enough on the same Wi-Fi; away from it, tunnel — no port-forwarding, no VPN.

不想开终端?菜单栏 app 里点两下就是同一道门:点菜单栏的 gtmux 图标 → ⚙︎ → 偏好设置… → 远程访问,同样的三档开关 关 / 局域网 / 任意网络,任意网络下还能选隧道走 标准(托管、免费)还是直连(443 直连,访问码解锁或自托管),开着时会显示当前可达地址。⚙︎ 菜单里的「配对设备…」直接弹出配对码(门没开会先领你把门打开),下面第 2 步的扫码就用它。Don’t want a terminal? The same door is two clicks in the menu-bar app: click the gtmux status icon → ⚙︎ → Preferences… → Remote access — the same three-way switch, Off / Wi-Fi / Anywhere, plus a tunnel choice under Anywhere: Standard (hosted, free) or Direct (straight over 443 — access-code unlock, or self-hosted), with the reachable address shown while it’s on. “Pair a device…” in the ⚙︎ menu pops the pairing code directly (walking you through opening the door first if it’s off) — that’s the QR step 2 scans.

menu-bar app Preferences — Remote access: Off / Wi-Fi / Anywhere, tunnel Standard / Direct

延展阅读:远程访问全指南(Tailscale、隧道后端、自托管、安全边界)→Further reading: the full remote-access doc (Tailscale, tunnel backends, self-hosting, security) →

2 · 配上你的手机2 · Pair your phone

gtmux pair                 # one one-time code — scan it in the iOS app

iOS app 里「配对 → 扫码」,扫一次就好。之后手机上是一整套:雷达(和 Mac 上同一套颜色和排序)、点进任何会话看终端镜像、agent 提问时的 1 / 2 / 3 审批卡、往 pane 里打字、agent 卡住那一刻的锁屏推送,还有 HQ 中控页。这是你自己的设备——全权,和坐在 Mac 前一样。In the iOS app: Pair → Scan, once. After that the phone has the whole kit: the radar (same colors and ordering as the Mac), a terminal mirror inside any session, the 1 / 2 / 3 approval card when an agent asks, typing into a pane, a lock-screen push the moment one blocks — and the HQ page. This is your own device: full control, same as sitting at the Mac.

3 · 或者用浏览器,什么都不装3 · Or use a browser — nothing to install

同一个 gtmux pair 印出的东西里有一条浏览器链接——在任何电脑的浏览器里打开,就是你的雷达和终端镜像。临时借的电脑、公司的 Windows 机、iPad,都能用。The same gtmux pair printout includes a browser link — open it in any browser and you have your radar and terminal mirror. A borrowed laptop, an office Windows box, an iPad: all fine.

4 · 把一个会话开给协作者4 · Open one session to a collaborator

gtmux share new            # mint a scoped guest link
gtmux share view add %7    # they can SEE this pane
gtmux share on             # master switch: allow typing at all
gtmux share add %7         # …and TYPE into this pane (implies view)
gtmux share revoke <id>    # done — the link dies instantly

访客链接默认什么都看不到:你按 pane 放开「能看」,需要时再放开「能输入」。对方在浏览器里打开就能协作——看着 agent 跑、帮你回一句——但只能碰你放开的那几个 pane,碰不到 HQ、碰不到偏好、更拿不到整台 Mac。用完 revoke,链接立刻失效。A guest link starts with nothing visible: you open “can view” per pane, and “can type” only where needed. They open it in a browser and collaborate — watch the agent run, answer a prompt for you — but touch only the panes you opened; never HQ, never preferences, never the rest of the Mac. revoke when you’re done and the link dies instantly.

5 · 心里有数的三件事5 · Three things to keep in mind

配对码是一次性的,5 分钟过期;配上后的设备 token 等同密码——丢了设备就在 Mac 上吊销(gtmux devices revoke)。访客和自己人是两条轨:pair 全权、share 受限,永远不会混。吊销和开关远程访问只能在 Mac 上操作——手机丢了也改不了这台机器的门禁。The pairing code is one-time and expires in five minutes; a paired device’s token is a password — lose the device, revoke it on the Mac (gtmux devices revoke). Guests and your own devices are separate tracks: pair is full control, share is scoped, and they never mix. Revoking and toggling remote access happen only on the Mac — a lost phone can’t re-key the machine.


接下来:想要一个真正的终端而不是镜像?从任意电脑 attach 接回会话 → Next: want a real terminal, not a mirror? Attach from any computer →