docs: BUILD.md — fix pair command, use GET /pair-qr endpoint

This commit is contained in:
Johannes Merz 2026-05-16 02:56:20 +02:00
parent 91baac5420
commit ad95ea3efd
1 changed files with 12 additions and 2 deletions

View File

@ -72,14 +72,24 @@ xcrun devicectl device process launch \
## 5. Pair the iOS app with the sidecar
Run on Mac (sidecar must be running):
Run on Mac (sidecar must be running), with the token from step 1:
```bash
node /Users/jay/.pi/agent/git/git.vpsj.de/jay/pi-remote-control/extensions/remote-control/cli/index.js pair
# Get the token from the sidecar URL, then:
curl -s "http://<SIDECAR_URL>/pair-qr?token=<TOKEN>"
```
Or one-liner (reads token from tmux pane automatically):
```bash
TOKEN=$(tmux capture-pane -t pi-sidecar -p | grep -o 'token=[^ ]*' | head -1 | cut -d= -f2) && \
SIDECAR=$(tmux capture-pane -t pi-sidecar -p | grep -o 'http://[^ ]*' | head -1 | sed 's/?.*//') && \
curl -s "$SIDECAR/pair-qr?token=$TOKEN"
```
Scan the QR code with the iPhone app. App stores the bearer token in Keychain
and connects automatically.
Note: CLI `index.ts` requires pi's TypeScript runtime — use the HTTP endpoint above instead.
## 6. One-liner: build + install + launch
```bash