#!/bin/sh # Install Terminal agent skills (https://agentskills.io format). # Generated by scripts/build-data.ts — edit scripts/templates/install-skills.sh. # # curl -fsSL https://terminal.rokibulroni.com/skills/install.sh | sh # curl -fsSL https://terminal.rokibulroni.com/skills/install.sh | sh -s -- --project terminal-hub-network # # Options: # --target claude|codex|agents Where to install (default: claude) # --project Install into .//skills instead of your home directory # --dir PATH Install into PATH (overrides --target/--project) # --list List available skills and exit # -h, --help Show this help # Arguments: skill names to install (default: all skills). # # Set TERMINAL_HUB_URL to install from another origin (e.g. a local preview). set -eu BASE_URL="${TERMINAL_HUB_URL:-https://terminal.rokibulroni.com}" BASE_URL="${BASE_URL%/}" ALL_SKILLS="terminal-hub terminal-hub-network terminal-hub-web terminal-hub-enumeration terminal-hub-exploitation terminal-hub-credentials terminal-hub-lateral terminal-hub-wireless terminal-hub-forensics terminal-hub-monitoring terminal-hub-cloud terminal-hub-traffic terminal-hub-utilities terminal-hub-osint terminal-hub-mobile terminal-hub-containers terminal-hub-reversing terminal-hub-linux terminal-hub-iot terminal-hub-active-directory terminal-hub-pivoting terminal-hub-crypto" TARGET=claude SCOPE=user DEST="" SKILLS="" die() { printf 'error: %s\n' "$1" >&2; exit 1; } while [ $# -gt 0 ]; do case "$1" in --target) [ $# -ge 2 ] || die "--target needs a value"; TARGET="$2"; shift 2 ;; --target=*) TARGET="${1#*=}"; shift ;; --project) SCOPE=project; shift ;; --dir) [ $# -ge 2 ] || die "--dir needs a value"; DEST="$2"; shift 2 ;; --dir=*) DEST="${1#*=}"; shift ;; --list) for s in $ALL_SKILLS; do echo "$s"; done; exit 0 ;; -h|--help) echo "Usage: install.sh [--target claude|codex|agents] [--project] [--dir PATH] [--list] [skill...]" echo "Skills: $ALL_SKILLS" exit 0 ;; -*) die "unknown option: $1" ;; *) SKILLS="$SKILLS $1"; shift ;; esac done if [ -z "$DEST" ]; then case "$TARGET" in claude) sub=.claude/skills ;; codex) sub=.codex/skills ;; agents) sub=.agents/skills ;; *) die "unknown target '$TARGET' (use claude, codex or agents, or --dir PATH)" ;; esac if [ "$SCOPE" = project ]; then DEST="./$sub"; else DEST="${HOME:?HOME is not set}/$sub"; fi fi command -v curl >/dev/null 2>&1 || die "curl is required" command -v tar >/dev/null 2>&1 || die "tar is required" [ -n "$SKILLS" ] || SKILLS="$ALL_SKILLS" # Validate every requested name against the published list before touching the disk. for s in $SKILLS; do case " $ALL_SKILLS " in *" $s "*) ;; *) die "unknown skill '$s' (run with --list to see available skills)" ;; esac done mkdir -p "$DEST" n=0 for s in $SKILLS; do printf 'Installing %s… ' "$s" curl -fsSL "$BASE_URL/skills/archives/$s.tar.gz" | tar -xzf - -C "$DEST" echo ok n=$((n + 1)) done echo "Installed $n skill(s) into $DEST" echo "Restart your agent (or start a new session) to pick them up."