scripts/install-cli.sh: build + install colony binaries on VM
Installs Rust if needed, builds release binaries, copies to /usr/local/bin. Run on colony-vm to prepare for agent birth. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
41
scripts/install-cli.sh
Executable file
41
scripts/install-cli.sh
Executable file
@@ -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'"
|
||||||
Reference in New Issue
Block a user