Skip to content

Pairing from a headless PC: a code in the terminal, and the pairing link as text - #62

Merged
devswha merged 1 commit into
mainfrom
feat/pair-cli
Sep 26, 2026
Merged

devswha merged 1 commit into
mainfrom
feat/pair-cli

Conversation

@devswha

@devswha devswha commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Why

A user on a headless Linux box reported that the pairing flow assumes a screen: the QR code and the six-digit code are shown in Settings → Devices, which lives in a browser nobody can open on a headless PC, and there is no way to feed a screenshot in either.

What

  • bun scripts/plugin.ts pair: asks the running server for a pairing code (POST /api/devices/pair/start, with the token from the plugin's env file when one is configured) and prints the code, the address a phone opens when Tailscale already serves one, and that address as a QR code rendered in the terminal (qrcode-generator's ASCII output). With no served address it says to open the app's address and enter the code. The herdr action devswha.herdr-web-ui.pair runs the same; herdr keeps an action's output in herdr plugin log list rather than printing it, so the docs give the direct command first, with a glob that resolves the plugin checkout.
  • Settings → Devices: the pairing link (https://…/?pair=CODE) now shows as text next to the QR code, with Copy, so it can be sent to the other device however you like.
  • The sign-in screen and the Devices description name the terminal command as the other source of a code.
  • README (Quick start, Access and safety), INSTALL.md step 5, CHANGELOG.

Verified

  • Contract test: the script run against the test server prints a 6-digit code that pairs a device, and with a token configured it reads the token from the plugin env file and still gets a code. (Spawned asynchronously; a synchronous spawn would block the in-process server it asks.)
  • Headless Chrome against the test herdr: the link row renders under the code; Copy says Copied.
  • The README's glob resolves the real plugin checkout on this machine.
  • bun run typecheck, bun test src/lib (i18n dictionary complete), bun run build.

🤖 Generated with Claude Code

… text

A headless PC has no browser to open Settings → Devices in, so its owner had no way to pair a
phone: the QR code and the six digits both lived in a page nobody could open on that PC.

- `bun scripts/plugin.ts pair` (and herdr's `pair` action, which runs it and keeps the output in
  the plugin log) starts a pairing on the running server and prints the code, the address a
  phone opens when Tailscale serves one, and that address as a QR code in the terminal. With a
  token configured it reads the token from the plugin's env file, like `start` does.
- Settings → Devices shows the pairing link as text next to the QR code, with Copy, so it can be
  sent to the other device through any channel when no camera is at hand.
- The sign-in screen and Devices copy name the terminal command as the other source of a code.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant