diff --git a/scripts/install-cli.sh b/scripts/install-cli.sh new file mode 100755 index 0000000..f71743a --- /dev/null +++ b/scripts/install-cli.sh @@ -0,0 +1,41 @@ +#!/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 " npm install -g @anthropic-ai/claude-code" +echo "" +echo "Then birth an agent:" +echo " sudo bash scripts/birth.sh scout 'help with research'"