#!/bin/sh # Installs the Hesperan agent skill into the coding agents found on this machine. # Read before running: it only downloads the skill files from https://hesperan.com and copies them into # each agent's skills directory. Nothing else is changed; no data is sent anywhere. set -eu BASE="${HESPERAN_SITE:-https://hesperan.com}" NAME=hesperan FILES="SKILL.md LICENSE scripts/judge.mjs" fetch() { if command -v curl >/dev/null 2>&1; then curl -fsSL "$1" -o "$2" elif command -v wget >/dev/null 2>&1; then wget -qO "$2" "$1" else echo "hesperan: need curl or wget" >&2; exit 1; fi } TMP=$(mktemp -d) trap 'rm -rf "$TMP"' EXIT for f in $FILES; do mkdir -p "$TMP/$(dirname "$f")" fetch "$BASE/skill/$f" "$TMP/$f" done chmod +x "$TMP/scripts/judge.mjs" INSTALLED="" install_to() { dest="$1/$NAME" mkdir -p "$dest" cp -R "$TMP/." "$dest/" INSTALLED="$INSTALLED $dest" } # the shared location many agents read, then every agent that is present install_to "$HOME/.agents/skills" [ -d "$HOME/.claude" ] && install_to "$HOME/.claude/skills" CODEX_DIR="${CODEX_HOME:-$HOME/.codex}" [ -d "$CODEX_DIR" ] && install_to "$CODEX_DIR/skills" [ -d "$HOME/.cursor" ] && install_to "$HOME/.cursor/skills" [ -d "$HOME/.gemini" ] && install_to "$HOME/.gemini/skills" [ -d "$HOME/.config/opencode" ] && install_to "$HOME/.config/opencode/skills" echo "Hesperan skill installed:$INSTALLED" echo echo "Next: create an API key at $BASE/console/keys and set it for your agent:" echo " export HESPERAN_API_KEY=hsp_..." echo "Restart your agent so it picks up the new skill."