diff --git a/civo/openclaw.sh b/civo/openclaw.sh new file mode 100644 index 00000000..4081824e --- /dev/null +++ b/civo/openclaw.sh @@ -0,0 +1,56 @@ +#!/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 "OpenClaw 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 openclaw..." +run_server "${CIVO_SERVER_IP}" "source ~/.bashrc && bun install -g openclaw" +log_info "OpenClaw 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" "Openclaw") || 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}" \ + "ANTHROPIC_API_KEY=${OPENROUTER_API_KEY}" \ + "ANTHROPIC_BASE_URL=https://openrouter.ai/api" + +setup_openclaw_config "${OPENROUTER_API_KEY}" "${MODEL_ID}" \ + "upload_file ${CIVO_SERVER_IP}" \ + "run_server ${CIVO_SERVER_IP}" + +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 openclaw..." +run_server "${CIVO_SERVER_IP}" "source ~/.zshrc && nohup openclaw gateway > /tmp/openclaw-gateway.log 2>&1 &" +sleep 2 +interactive_session "${CIVO_SERVER_IP}" "source ~/.zshrc && openclaw tui" diff --git a/manifest.json b/manifest.json index 21c8fb13..853fad75 100644 --- a/manifest.json +++ b/manifest.json @@ -512,18 +512,18 @@ "civo/claude": "implemented", "civo/aider": "implemented", "civo/codex": "implemented", - "civo/openclaw": "missing", - "civo/nanoclaw": "missing", - "civo/goose": "missing", - "civo/interpreter": "missing", + "civo/openclaw": "implemented", + "civo/nanoclaw": "implemented", + "civo/goose": "implemented", + "civo/interpreter": "implemented", "civo/gemini": "missing", "civo/amazonq": "missing", "civo/cline": "missing", "civo/gptme": "missing", "sprite/opencode": "implemented", "hetzner/opencode": "implemented", - "digitalocean/opencode": "missing", - "vultr/opencode": "missing", + "digitalocean/opencode": "implemented", + "vultr/opencode": "implemented", "linode/opencode": "missing", "lambda/opencode": "missing", "aws-lightsail/opencode": "missing",