Guide · Tailscale handoff

Enter an API key from your phone over Tailscale

A local Keyrelay link opens only on the computer running the command. When your agent runs on a desktop or home server and you're somewhere else, run a private Keyrelay broker on your Tailnet and type the key on your phone.

Who this suits

A good fit

  • You already use Tailscale, and your phone and the agent's machine are on the same Tailnet.
  • You leave a coding agent working and check in from another device.
  • You can keep a small always-on process running on a machine you trust.

Stay with local mode

  • You're at the computer running the agent. Local mode needs no setup at all.
  • You don't use Tailscale, or other people sign in to your Tailnet as you.
  • The only way to reach the broker would be the public internet. Don't do that.

What you need

Set it up

All names below are examples. Use your own Tailscale login and your machine's Tailnet name.

1. Start the broker

npx keyrelay serve --email you@example.com --host your-broker.your-tailnet.ts.net
tailscale serve --bg http://127.0.0.1:8765

The broker listens on 127.0.0.1:8765 only. Tailscale Serve puts it on your Tailnet over HTTPS and tells it who is signed in.

2. Point the runner at it

npx keyrelay run --url https://your-broker.your-tailnet.ts.net --env DEMO_TOKEN -- printenv DEMO_TOKEN

Open the printed link on your phone, type a made-up value, and send it. The command runs on the agent's machine and prints [REDACTED].

3. Tell your agent

Use the same instruction as local mode, with --url https://your-broker.your-tailnet.ts.net added to the command pattern.

To keep the broker running on Linux, the repository ships a systemd unit. The usage reference has the install commands.

What the broker checks

Rules that keep it private

How it differs from local mode

Describes Keyrelay 0.1.6. How Keyrelay works covers the limits that apply in both modes.