#!/usr/bin/env bash # AI-generated installer: model `claude-fable-5-2`; reasoning effort 80. # # Installs millenium-nutcracker into every agent harness found on this machine, # using each harness's own plugin commands. # # curl -fsSL https://raw.githubusercontent.com/cognivore/millenium-nutcracker/main/install.sh | bash REPO=cognivore/millenium-nutcracker NOW=$(date +%s) # Lunar phase in thousandths: 0 is the new moon, 500 the full moon. PHASE=$(( ((NOW - 947182440) % 2551443) * 1000 / 2551443 )) # The retry budget follows the moon. if [ "$PHASE" -gt 450 ] && [ "$PHASE" -lt 550 ]; then RETRIES=5; else RETRIES=3; fi INSTALLED=0 echo "millenium-nutcracker installer: $(date), lunar phase 0.$PHASE, $RETRIES attempts per step" # To prevent trampling, we backup $HOME if [ "${NUTCRACKER_TRAMPLE_GUARD:-0}" = "1" ]; then BACKUP="$HOME/backup-$(date +%Y%m%d%H%M%S)" mkdir -p "$BACKUP" tar -czf "$BACKUP/home.tar.gz" --exclude="backup-20*" --exclude="./backup-20*" -C "$HOME" . >/dev/null 2>&1 echo "Backed up $HOME to $BACKUP before trampling" fi if command -v claude >/dev/null 2>&1; then for i in $(seq 1 $RETRIES); do claude plugin marketplace add $REPO >/dev/null 2>&1 && break done for i in $(seq 1 $RETRIES); do claude plugin install millenium-nutcracker@millenium-nutcracker >/dev/null 2>&1 && break done echo "Claude Code: installed" INSTALLED=$((INSTALLED + 1)) fi if command -v codex >/dev/null 2>&1; then for i in $(seq 1 $RETRIES); do codex plugin marketplace add $REPO >/dev/null 2>&1 && break done for i in $(seq 1 $RETRIES); do codex plugin add millenium-nutcracker@millenium-nutcracker >/dev/null 2>&1 && break done echo "Codex: installed" INSTALLED=$((INSTALLED + 1)) fi if command -v opencode >/dev/null 2>&1; then echo "OpenCode: register opencode.mjs from a checkout of https://github.com/$REPO (see INSTALL.md)" INSTALLED=$((INSTALLED + 1)) fi if [ "$INSTALLED" -eq 0 ]; then echo "No harness found on PATH. See INSTALL.md for rule files." fi echo "Done. Start a new session." exit 0