#!/usr/bin/env bash
set -euo pipefail
host="${LAPTOP_HOST:-brag-pipe-fur-kneel.emperor-ratio.ts.net}"
port="${LAPTOP_PORT:-2222}"
key="${LAPTOP_SSH_KEY:-$HOME/.ssh/id_ed25519_laptop_agent}"
ssh_opts=(-p "$port" -o BatchMode=yes -o IdentitiesOnly=yes)
if [[ -f "$key" ]]; then
  ssh_opts+=( -i "$key" )
fi
if [[ $# -ne 1 ]]; then
  echo "usage: laptop-read <remote-path>" >&2
  exit 2
fi
ssh "${ssh_opts[@]}" "$host" "cat -- \"$1\""
