#!/usr/bin/env bash
# snappy-share -- thin wrapper so you can bind a hotkey to one command.
#
#   snappy-share            # latest ~/Desktop screenshot
#   snappy-share --region   # interactive crosshair capture (like ⌘⇧4)
#   snappy-share <file>     # specific file
#
# URL is echoed AND copied to the clipboard AND shown in a notification.

set -euo pipefail

SKILL_DIR="${HOME}/.claude/skills/snappy-sync"

if [[ $# -eq 0 ]]; then
  exec npx tsx "${SKILL_DIR}/api.ts" share --latest-screenshot
fi

exec npx tsx "${SKILL_DIR}/api.ts" share "$1"
