spawn/cloudsigma/gemini.sh
A 1a2cec6b81
feat: Add CloudSigma support for 6 agents (#998)
Implements CloudSigma matrix entries for openclaw, nanoclaw, interpreter, continue, gemini, and codex. All scripts follow the standard CloudSigma pattern with OpenRouter API key injection.

Agent: gap-filler

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 12:57:49 -08:00

48 lines
1.6 KiB
Bash

#!/bin/bash
set -eo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
# shellcheck source=cloudsigma/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/cloudsigma/lib/common.sh)"
fi
log_info "Gemini CLI on CloudSigma"
echo ""
ensure_cloudsigma_credentials
ensure_ssh_key
SERVER_NAME=$(get_server_name)
create_server "${SERVER_NAME}"
verify_server_connectivity "${CLOUDSIGMA_SERVER_IP}"
wait_for_cloud_init "${CLOUDSIGMA_SERVER_IP}" 60
log_step "Installing Node.js and Gemini CLI..."
run_server "${CLOUDSIGMA_SERVER_IP}" "curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs && npm install -g @google/gemini-cli"
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
log_step "Setting up environment variables..."
inject_env_vars_ssh "${CLOUDSIGMA_SERVER_IP}" upload_file run_server \
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
"GEMINI_API_KEY=${OPENROUTER_API_KEY}" \
"OPENAI_API_KEY=${OPENROUTER_API_KEY}" \
"OPENAI_BASE_URL=https://openrouter.ai/api/v1"
echo ""
log_info "CloudSigma instance setup completed successfully!"
log_info "Server: ${SERVER_NAME} (UUID: ${CLOUDSIGMA_SERVER_UUID}, IP: ${CLOUDSIGMA_SERVER_IP})"
echo ""
log_step "Starting Gemini..."
sleep 1
clear
interactive_session "${CLOUDSIGMA_SERVER_IP}" "source ~/.zshrc && gemini"