Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

claude-pair.sh

24 lines726 Bytes

1#!/usr/bin/env bash
2# Mint a fresh pairing token for the Workbench dev server and print the /pair URL.
3# Used to give agents (or a second browser) access to the dev app without
4# hand-copying a token from the authenticated session.
5#
6# Usage (from the repo root):
7# ./scripts/claude-pair.sh # 24h default
8# ./scripts/claude-pair.sh 7d # custom TTL
9#
10# Requires the dev server (bun dev) to be running against its default baseDir.
11​
12set -euo pipefail
13​
14cd "$(dirname "$0")/.."
15​
16TTL="${1:-24h}"
17​
18node apps/server/src/bin.ts auth pairing create \
19 --dev-url http://localhost:5733 \
20 --base-url http://localhost:5733 \
21 --ttl "$TTL" \
22 --label agent-dev \
23 2>/dev/null \
24 | awk '/^Pair URL:/ {print $3}'