mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-05 23:50:48 +00:00
Civo is a cloud-native provider with fast provisioning (~45s), REST API, hourly billing, free data transfer, and NVMe storage. Implements claude, aider, and codex agent scripts using the same SSH-based patterns as Vultr/Hetzner/DigitalOcean. - civo/lib/common.sh: Provider library with auth, SSH key management, instance creation/destruction, network/image auto-discovery - civo/claude.sh, aider.sh, codex.sh: Agent deployment scripts - manifest.json: Added civo cloud entry + matrix entries - civo/README.md: Usage instructions and env var docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
50 lines
1.5 KiB
Bash
50 lines
1.5 KiB
Bash
#!/bin/bash
|
|
set -eo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
|
# shellcheck source=civo/lib/common.sh
|
|
if [[ -f "${SCRIPT_DIR}/lib/common.sh" ]]; then
|
|
source "${SCRIPT_DIR}/lib/common.sh"
|
|
else
|
|
eval "$(curl -fsSL https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/civo/lib/common.sh)"
|
|
fi
|
|
|
|
log_info "Aider on Civo"
|
|
echo ""
|
|
|
|
ensure_civo_token
|
|
ensure_ssh_key
|
|
|
|
SERVER_NAME=$(get_server_name)
|
|
create_server "${SERVER_NAME}"
|
|
verify_server_connectivity "${CIVO_SERVER_IP}"
|
|
|
|
log_warn "Waiting for cloud-init to complete..."
|
|
generic_ssh_wait "root" "${CIVO_SERVER_IP}" "${SSH_OPTS} -o ConnectTimeout=5" "test -f /root/.cloud-init-complete" "cloud-init" 60 5
|
|
|
|
log_warn "Installing Aider..."
|
|
run_server "${CIVO_SERVER_IP}" "pip install aider-chat 2>/dev/null || pip3 install aider-chat"
|
|
log_info "Aider installed"
|
|
|
|
echo ""
|
|
if [[ -n "${OPENROUTER_API_KEY:-}" ]]; then
|
|
log_info "Using OpenRouter API key from environment"
|
|
else
|
|
OPENROUTER_API_KEY=$(get_openrouter_api_key_oauth 5180)
|
|
fi
|
|
|
|
MODEL_ID=$(get_model_id_interactive "openrouter/auto" "Aider") || exit 1
|
|
|
|
log_warn "Setting up environment variables..."
|
|
inject_env_vars_ssh "${CIVO_SERVER_IP}" upload_file run_server \
|
|
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}"
|
|
|
|
echo ""
|
|
log_info "Civo instance setup completed successfully!"
|
|
log_info "Server: ${SERVER_NAME} (ID: ${CIVO_SERVER_ID}, IP: ${CIVO_SERVER_IP})"
|
|
echo ""
|
|
|
|
log_warn "Starting Aider..."
|
|
sleep 1
|
|
clear
|
|
interactive_session "${CIVO_SERVER_IP}" "source ~/.zshrc && aider --model openrouter/${MODEL_ID}"
|