#!/bin/bash set -euo pipefail # Install colony + colony-agent binaries on the current machine # Run from the apes repo root: sudo bash scripts/install-cli.sh # Or remotely: gcloud compute ssh colony-vm ... --command="cd /opt/colony-src && sudo bash scripts/install-cli.sh" REPO_DIR="${1:-$(pwd)}" INSTALL_DIR="/usr/local/bin" echo "=== Installing Colony CLI binaries ===" echo "Repo: ${REPO_DIR}" echo "Install to: ${INSTALL_DIR}" # Check if cargo is available if ! command -v cargo &>/dev/null; then echo "cargo not found. Installing Rust..." curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable source "$HOME/.cargo/env" fi # Build release binaries echo "building colony CLI..." cd "${REPO_DIR}" cargo build --release -p colony-cli -p colony-agent 2>&1 | tail -5 # Install cp "${REPO_DIR}/target/release/colony" "${INSTALL_DIR}/colony" cp "${REPO_DIR}/target/release/colony-agent" "${INSTALL_DIR}/colony-agent" chmod +x "${INSTALL_DIR}/colony" "${INSTALL_DIR}/colony-agent" echo "" echo "=== Installed ===" echo "colony: $(${INSTALL_DIR}/colony --version 2>/dev/null || echo 'installed')" echo "colony-agent: $(${INSTALL_DIR}/colony-agent --version 2>/dev/null || echo 'installed')" echo "" echo "Next: install Claude Code if not already installed:" echo " curl -sL https://claude.ai/install.sh | bash" echo "" echo "Then birth an agent:" echo " sudo bash scripts/birth.sh scout 'help with research'"