#!/bin/bash
# bootstrap.sh — One-time setup for pi-skill
# Registers pi-skill as a Pi package so all 50+ skills, 43 extensions, and 11 themes are auto-discovered.
# After this, just restart Pi.
#
# Usage: ./bootstrap.sh

set -e

SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo "╔══════════════════════════════════════════════╗"
echo "║     pi-skill Bootstrap                       ║"
echo "╚══════════════════════════════════════════════╝"
echo ""

# Check if pi is installed
if ! command -v pi &> /dev/null; then
    echo "ERROR: 'pi' command not found. Install Pi first:"
    echo "  npm install -g @mariozechner/pi-coding-agent"
    exit 1
fi

# Register pi-skill as a Pi package
echo "Registering pi-skill with Pi..."
pi install "$SOURCE_DIR"
echo ""

echo "✓ pi-skill registered at: $SOURCE_DIR"
echo ""
echo "Next steps:"
echo "  1. Restart Pi agent"
echo "  2. All 50+ skills, 43 extensions, and 11 themes will be loaded"
echo "  3. Type / to see available commands"
echo ""
