Repository navigation
Pairing from a headless PC: a code in the terminal, and the pairing link as text - #62
Merged
Merged
Conversation
… 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 actiondevswha.herdr-web-ui.pairruns the same; herdr keeps an action's output inherdr plugin log listrather than printing it, so the docs give the direct command first, with a glob that resolves the plugin checkout.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.Verified
bun run typecheck,bun test src/lib(i18n dictionary complete),bun run build.🤖 Generated with Claude Code