#!/usr/bin/env bash # YouTube SEO Skills installer for Claude Code. # # Usage: # Global install (default — all Claude Code sessions): # curl -fsSL https://raw.githubusercontent.com/deeployCO/youtube-seo-skills/main/install.sh | bash # # Project-local install (only this project): # curl -fsSL https://raw.githubusercontent.com/deeployCO/youtube-seo-skills/main/install.sh | bash -s -- --local # # Custom target: # curl -fsSL https://raw.githubusercontent.com/deeployCO/youtube-seo-skills/main/install.sh | bash -s -- --target /path/to/skills # # The installer downloads the latest tagged release tarball from GitHub, # extracts the skill folders, and copies them into your Claude Code # skills directory. set -euo pipefail REPO="deeployCO/youtube-seo-skills" DEFAULT_GLOBAL="${HOME}/.claude/skills" DEFAULT_LOCAL="./.claude/skills" TARGET="" MODE="global" REF="latest" while [[ $# -gt 0 ]]; do case "$1" in --local) MODE="local"; shift ;; --global) MODE="global"; shift ;; --target) TARGET="$2"; shift 2 ;; --ref) REF="$2"; shift 2 ;; # e.g. main, v0.1.0 -h|--help) grep '^#' "$0" | sed 's/^# \{0,1\}//' exit 0 ;; *) echo "Unknown arg: $1" >&2 exit 1 ;; esac done if [[ -z "$TARGET" ]]; then if [[ "$MODE" == "local" ]]; then TARGET="$DEFAULT_LOCAL" else TARGET="$DEFAULT_GLOBAL" fi fi echo "▶ YouTube SEO Skills installer" echo " Repo: $REPO" echo " Ref: $REF" echo " Target: $TARGET" echo for bin in curl tar mkdir cp; do if ! command -v "$bin" >/dev/null 2>&1; then echo "✗ Required command not found: $bin" >&2 exit 1 fi done mkdir -p "$TARGET" if [[ "$REF" == "latest" ]]; then TARBALL_URL="https://github.com/${REPO}/archive/refs/heads/main.tar.gz" else TARBALL_URL="https://github.com/${REPO}/archive/refs/tags/${REF}.tar.gz" fi TMPDIR="$(mktemp -d)" trap 'rm -rf "$TMPDIR"' EXIT echo "▶ Downloading $TARBALL_URL" curl -fsSL "$TARBALL_URL" -o "$TMPDIR/pkg.tar.gz" echo "▶ Extracting" tar -xzf "$TMPDIR/pkg.tar.gz" -C "$TMPDIR" SRC_DIR="$(find "$TMPDIR" -maxdepth 1 -type d -name 'youtube-seo-skills-*' | head -n1)" if [[ -z "$SRC_DIR" ]]; then echo "✗ Could not locate extracted directory" >&2 exit 1 fi echo "▶ Installing skills" SKILLS=( youtube-seo youtube-seo-audit youtube-seo-video youtube-seo-optimize youtube-seo-channel youtube-seo-keywords youtube-seo-thumbnail youtube-seo-competitor ) for skill in "${SKILLS[@]}"; do if [[ -d "$SRC_DIR/$skill" ]]; then rm -rf "${TARGET:?}/$skill" cp -R "$SRC_DIR/$skill" "$TARGET/$skill" echo " ✓ $skill" else echo " ✗ $skill (missing in tarball)" >&2 fi done # Helper scripts go inside the orchestrator skill so they travel with it if [[ -d "$SRC_DIR/scripts" ]]; then mkdir -p "$TARGET/youtube-seo/scripts" cp -R "$SRC_DIR/scripts/." "$TARGET/youtube-seo/scripts/" echo " ✓ scripts/ (fetch_video.py, fetch_channel.py, analyze_thumbnail.py, audio_loudness.py)" fi cat <