#!/bin/sh # shipd team — pair your phone to the team app (mcp.aikaara.com/team). # # curl -fsSL https://shipd.aikaara.com/team | sh # # Needs a TEAM token (~/.shipd/token from `join`, with the team gate enabled by # an operator). Prints a one-time URL (10 min) — open it on the phone, create a # passkey there, turn on notifications. From then on: passkey sign-in, push on # every dev message and bug report. set -eu API="${SHIPD_API:-https://api.aikaara.com/api/v1/mcp}" TOKEN="${SHIPD_TOKEN:-$(cat "$HOME/.shipd/token" 2>/dev/null || true)}" [ -n "$TOKEN" ] || { echo "shipd: no token — run: curl -fsSL https://shipd.aikaara.com/join | sh" >&2; exit 1; } res=$(curl -sS -X POST "$API/team/pair" -H "Authorization: Bearer $TOKEN") URL=$(printf '%s' "$res" | python3 -c 'import sys,json; d=json.load(sys.stdin); print(d.get("url",""))' 2>/dev/null || true) [ -n "$URL" ] || { echo "shipd: $(printf '%s' "$res" | python3 -c 'import sys,json; print(json.load(sys.stdin).get("error","pairing failed"))')" >&2; exit 1; } echo "" echo "open this on your phone (valid 10 min, once):" echo "" echo " $URL" echo "" if command -v qrencode >/dev/null 2>&1; then qrencode -t ANSIUTF8 "$URL"; else echo " (brew install qrencode for a QR code)"; fi echo "" echo "then: create passkey → me → enable notifications. iPhone: add to Home Screen first."