mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-05 23:50:48 +00:00
refactor: Remove 8 GPU cloud providers
Spawn agents use remote LLM APIs for inference — they need cheap CPU instances, not expensive GPU VMs. Removed: - Lambda Cloud - RunPod - Vast.ai - Hyperstack - FluidStack - Genesis Cloud - Paperspace - Crusoe Cloud This removes 112 matrix entries and ~8700 lines of GPU-specific code. Remaining: 25 clouds, 350 matrix entries — all affordable CPU compute. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3d0ac5e562
commit
f29f6946cd
107 changed files with 2 additions and 8699 deletions
|
|
@ -1,73 +0,0 @@
|
|||
# Genesis Cloud
|
||||
|
||||
Genesis Cloud GPU instances via REST API. [Genesis Cloud](https://www.genesiscloud.com/)
|
||||
|
||||
## Agents
|
||||
|
||||
#### Claude Code
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/claude.sh)
|
||||
```
|
||||
|
||||
#### OpenClaw
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/openclaw.sh)
|
||||
```
|
||||
|
||||
#### Aider
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/aider.sh)
|
||||
```
|
||||
|
||||
#### Amazon Q CLI
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/amazonq.sh)
|
||||
```
|
||||
|
||||
#### Cline
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/cline.sh)
|
||||
```
|
||||
|
||||
#### gptme
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/gptme.sh)
|
||||
```
|
||||
|
||||
#### OpenCode
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/opencode.sh)
|
||||
```
|
||||
|
||||
#### Plandex
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/plandex.sh)
|
||||
```
|
||||
|
||||
## Non-Interactive Mode
|
||||
|
||||
```bash
|
||||
GENESIS_SERVER_NAME=dev-gpu \
|
||||
GENESIS_API_KEY=your-api-key \
|
||||
OPENROUTER_API_KEY=sk-or-v1-xxxxx \
|
||||
bash <(curl -fsSL https://openrouter.ai/lab/spawn/genesiscloud/claude.sh)
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Description | Default |
|
||||
|----------|-------------|---------|
|
||||
| `GENESIS_API_KEY` | Genesis Cloud API key | _(prompted)_ |
|
||||
| `GENESIS_SERVER_NAME` | Instance name | _(prompted)_ |
|
||||
| `GENESIS_INSTANCE_TYPE` | Instance type | `vcpu-4_memory-12g_nvidia-rtx-3080-1` |
|
||||
| `GENESIS_REGION` | Datacenter region | `ARC-IS-HAF-1` |
|
||||
| `GENESIS_IMAGE` | OS image | `Ubuntu 24.04` |
|
||||
| `OPENROUTER_API_KEY` | OpenRouter API key | _(OAuth or prompted)_ |
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Aider on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Aider..."
|
||||
run_server "${GENESIS_SERVER_IP}" "pip install aider-chat 2>/dev/null || pip3 install aider-chat"
|
||||
|
||||
if ! run_server "${GENESIS_SERVER_IP}" "command -v aider &> /dev/null && aider --version &> /dev/null"; then
|
||||
log_error "Aider installation verification failed"
|
||||
exit 1
|
||||
fi
|
||||
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 "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Aider..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && aider --model openrouter/${MODEL_ID}"
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Amazon Q on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Amazon Q CLI..."
|
||||
run_server "${GENESIS_SERVER_IP}" "curl -fsSL https://desktop-release.q.us-east-1.amazonaws.com/latest/amazon-q-cli-install.sh | bash"
|
||||
log_info "Amazon Q CLI 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_BASE_URL=https://openrouter.ai/api/v1"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Amazon Q..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && q chat"
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Claude Code on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Verifying Claude Code installation..."
|
||||
if ! run_server "${GENESIS_SERVER_IP}" "command -v claude" >/dev/null 2>&1; then
|
||||
log_warn "Claude Code not found, installing manually..."
|
||||
run_server "${GENESIS_SERVER_IP}" "curl -fsSL https://claude.ai/install.sh | bash"
|
||||
fi
|
||||
log_info "Claude Code is 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"ANTHROPIC_BASE_URL=https://openrouter.ai/api" \
|
||||
"ANTHROPIC_AUTH_TOKEN=${OPENROUTER_API_KEY}" \
|
||||
"ANTHROPIC_API_KEY=" \
|
||||
"CLAUDE_CODE_SKIP_ONBOARDING=1" \
|
||||
"CLAUDE_CODE_ENABLE_TELEMETRY=0"
|
||||
|
||||
setup_claude_code_config "${OPENROUTER_API_KEY}" \
|
||||
"upload_file ${GENESIS_SERVER_IP}" \
|
||||
"run_server ${GENESIS_SERVER_IP}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Claude Code..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && claude"
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Cline on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Cline..."
|
||||
run_server "${GENESIS_SERVER_IP}" "npm install -g cline"
|
||||
log_info "Cline 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_BASE_URL=https://openrouter.ai/api/v1"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Cline..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && cline"
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Codex CLI on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Codex CLI..."
|
||||
run_server "${GENESIS_SERVER_IP}" "npm install -g @openai/codex"
|
||||
log_info "Codex CLI 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_BASE_URL=https://openrouter.ai/api/v1"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Codex..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && codex"
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Gemini CLI on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Gemini CLI..."
|
||||
run_server "${GENESIS_SERVER_IP}" "npm install -g @google/gemini-cli"
|
||||
log_info "Gemini CLI 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_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 "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Gemini..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && gemini"
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Goose on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Goose..."
|
||||
run_server "${GENESIS_SERVER_IP}" "CONFIGURE=false curl -fsSL https://github.com/block/goose/releases/latest/download/download_cli.sh | bash"
|
||||
|
||||
log_warn "Verifying Goose installation..."
|
||||
if ! run_server "${GENESIS_SERVER_IP}" "command -v goose" >/dev/null 2>&1; then
|
||||
log_error "Goose installation failed"
|
||||
exit 1
|
||||
fi
|
||||
log_info "Goose is 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"GOOSE_PROVIDER=openrouter" \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Goose..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && goose"
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=SC2154
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "gptme on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing gptme..."
|
||||
run_server "${GENESIS_SERVER_IP}" "pip install gptme 2>/dev/null || pip3 install gptme"
|
||||
|
||||
if ! run_server "${GENESIS_SERVER_IP}" "command -v gptme &> /dev/null && gptme --version &> /dev/null"; then
|
||||
log_error "gptme installation verification failed"
|
||||
log_error "The 'gptme' command is not available or not working properly on server ${GENESIS_SERVER_IP}"
|
||||
exit 1
|
||||
fi
|
||||
log_info "gptme 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" "gptme") || exit 1
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud instance setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting gptme..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && gptme -m openrouter/${MODEL_ID}"
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Open Interpreter on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Open Interpreter..."
|
||||
run_server "${GENESIS_SERVER_IP}" "pip install open-interpreter 2>/dev/null || pip3 install open-interpreter"
|
||||
log_info "Open Interpreter 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"OPENAI_BASE_URL=https://openrouter.ai/api/v1"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Open Interpreter..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && interpreter"
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Kilo Code on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Kilo Code CLI..."
|
||||
run_server "${GENESIS_SERVER_IP}" "npm install -g @kilocode/cli"
|
||||
log_info "Kilo Code CLI 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
|
||||
"KILO_PROVIDER_TYPE=openrouter" \
|
||||
"KILO_OPEN_ROUTER_API_KEY=${OPENROUTER_API_KEY}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Kilo Code..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && kilocode"
|
||||
|
|
@ -1,276 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Common bash functions for Genesis Cloud spawn scripts
|
||||
|
||||
# Bash safety flags
|
||||
set -eo pipefail
|
||||
|
||||
# ============================================================
|
||||
# Provider-agnostic functions
|
||||
# ============================================================
|
||||
|
||||
# Source shared provider-agnostic functions (local or remote fallback)
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
if [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/../../shared/common.sh" ]]; then
|
||||
source "$SCRIPT_DIR/../../shared/common.sh"
|
||||
else
|
||||
eval "$(curl -fsSL https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/shared/common.sh)"
|
||||
fi
|
||||
|
||||
# Note: Provider-agnostic functions (logging, OAuth, browser, etc) are now in shared/common.sh
|
||||
|
||||
# ============================================================
|
||||
# Genesis Cloud specific functions
|
||||
# ============================================================
|
||||
|
||||
readonly GENESIS_API_BASE="https://api.genesiscloud.com/compute/v1"
|
||||
# SSH_OPTS is now defined in shared/common.sh
|
||||
|
||||
# Configurable timeout/delay constants
|
||||
INSTANCE_STATUS_POLL_DELAY=${INSTANCE_STATUS_POLL_DELAY:-5}
|
||||
|
||||
# Centralized curl wrapper for Genesis Cloud API
|
||||
genesis_api() {
|
||||
local method="$1"
|
||||
local endpoint="$2"
|
||||
local body="${3:-}"
|
||||
generic_cloud_api "$GENESIS_API_BASE" "$GENESIS_API_KEY" "$method" "$endpoint" "$body"
|
||||
}
|
||||
|
||||
test_genesis_token() {
|
||||
local response
|
||||
response=$(genesis_api GET "/instances?per_page=1")
|
||||
if echo "$response" | grep -q '"error"'; then
|
||||
local error_msg
|
||||
error_msg=$(echo "$response" | python3 -c "import json,sys; d=json.loads(sys.stdin.read()); print(d.get('error',{}).get('message', d.get('message','No details available')))" 2>/dev/null || echo "Unable to parse error")
|
||||
log_error "API Error: $error_msg"
|
||||
log_warn "Remediation steps:"
|
||||
log_warn " 1. Verify API key at: https://developers.genesiscloud.com/"
|
||||
log_warn " 2. Ensure the key has read/write permissions"
|
||||
log_warn " 3. Check key hasn't been revoked"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
ensure_genesis_token() {
|
||||
ensure_api_token_with_provider \
|
||||
"Genesis Cloud" \
|
||||
"GENESIS_API_KEY" \
|
||||
"$HOME/.config/spawn/genesiscloud.json" \
|
||||
"https://developers.genesiscloud.com/ → API Keys" \
|
||||
"test_genesis_token"
|
||||
}
|
||||
|
||||
# Check if SSH key is registered with Genesis Cloud
|
||||
genesis_check_ssh_key() {
|
||||
local fingerprint="$1"
|
||||
local existing_keys
|
||||
existing_keys=$(genesis_api GET "/ssh-keys")
|
||||
echo "$existing_keys" | grep -q "$fingerprint"
|
||||
}
|
||||
|
||||
# Register SSH key with Genesis Cloud
|
||||
genesis_register_ssh_key() {
|
||||
local key_name="$1"
|
||||
local pub_path="$2"
|
||||
local pub_key
|
||||
pub_key=$(cat "$pub_path")
|
||||
local json_pub_key
|
||||
json_pub_key=$(json_escape "$pub_key")
|
||||
local register_body="{\"name\":\"$key_name\",\"value\":$json_pub_key}"
|
||||
local register_response
|
||||
register_response=$(genesis_api POST "/ssh-keys" "$register_body")
|
||||
|
||||
if echo "$register_response" | grep -q '"ssh_key"'; then
|
||||
return 0
|
||||
else
|
||||
local error_msg
|
||||
error_msg=$(echo "$register_response" | python3 -c "import json,sys; d=json.loads(sys.stdin.read()); print(d.get('error',{}).get('message', d.get('message','Unknown error')))" 2>/dev/null || echo "$register_response")
|
||||
log_error "API Error: $error_msg"
|
||||
|
||||
log_warn "Common causes:"
|
||||
log_warn " - SSH key already registered with this name"
|
||||
log_warn " - Invalid SSH key format (must be valid ed25519 public key)"
|
||||
log_warn " - API key lacks write permissions"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_ssh_key() {
|
||||
ensure_ssh_key_with_provider genesis_check_ssh_key genesis_register_ssh_key "Genesis Cloud"
|
||||
}
|
||||
|
||||
get_server_name() {
|
||||
local server_name
|
||||
server_name=$(get_resource_name "GENESIS_SERVER_NAME" "Enter instance name: ") || return 1
|
||||
|
||||
if ! validate_server_name "$server_name"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$server_name"
|
||||
}
|
||||
|
||||
# Fetch all SSH key IDs from Genesis Cloud account
|
||||
_genesis_fetch_ssh_key_ids() {
|
||||
local ssh_keys_response
|
||||
ssh_keys_response=$(genesis_api GET "/ssh-keys")
|
||||
echo "$ssh_keys_response" | python3 -c "
|
||||
import json, sys
|
||||
data = json.loads(sys.stdin.read())
|
||||
keys = data.get('ssh_keys', [])
|
||||
ids = [k['id'] for k in keys]
|
||||
print(json.dumps(ids))
|
||||
"
|
||||
}
|
||||
|
||||
# Build the JSON request body for Genesis Cloud instance creation
|
||||
_genesis_build_create_payload() {
|
||||
local name="$1" instance_type="$2" region="$3" image="$4" ssh_key_ids="$5"
|
||||
|
||||
local userdata
|
||||
userdata=$(get_cloud_init_userdata)
|
||||
local userdata_json
|
||||
userdata_json=$(echo "$userdata" | python3 -c "import json,sys; print(json.dumps(sys.stdin.read()))")
|
||||
|
||||
python3 -c "
|
||||
import json
|
||||
body = {
|
||||
'name': '$name',
|
||||
'type': '$instance_type',
|
||||
'region': '$region',
|
||||
'image': '$image',
|
||||
'ssh_key_ids': $ssh_key_ids,
|
||||
'startup_script': json.loads($userdata_json)
|
||||
}
|
||||
print(json.dumps(body))
|
||||
"
|
||||
}
|
||||
|
||||
# Poll Genesis Cloud API until instance is active, sets GENESIS_SERVER_IP
|
||||
_genesis_wait_for_active() {
|
||||
local server_id="$1"
|
||||
log_warn "Waiting for instance to become active..."
|
||||
local max_attempts=60
|
||||
local attempt=1
|
||||
while [[ "$attempt" -le "$max_attempts" ]]; do
|
||||
local status_response
|
||||
status_response=$(genesis_api GET "/instances/$server_id")
|
||||
local status
|
||||
status=$(echo "$status_response" | python3 -c "import json,sys; print(json.loads(sys.stdin.read())['instance']['status'])")
|
||||
|
||||
if [[ "$status" == "active" ]]; then
|
||||
GENESIS_SERVER_IP=$(echo "$status_response" | python3 -c "import json,sys; print(json.loads(sys.stdin.read())['instance']['public_ip'])")
|
||||
export GENESIS_SERVER_IP
|
||||
log_info "Instance active: IP=$GENESIS_SERVER_IP"
|
||||
return 0
|
||||
fi
|
||||
|
||||
log_warn "Instance status: $status ($attempt/$max_attempts)"
|
||||
sleep "${INSTANCE_STATUS_POLL_DELAY}"
|
||||
attempt=$((attempt + 1))
|
||||
done
|
||||
|
||||
log_error "Instance did not become active in time"
|
||||
return 1
|
||||
}
|
||||
|
||||
create_server() {
|
||||
local name="$1"
|
||||
local instance_type="${GENESIS_INSTANCE_TYPE:-vcpu-4_memory-12g_nvidia-rtx-3080-1}"
|
||||
local region="${GENESIS_REGION:-ARC-IS-HAF-1}"
|
||||
local image="${GENESIS_IMAGE:-Ubuntu 24.04}"
|
||||
|
||||
# Validate env var inputs to prevent injection into Python code
|
||||
validate_resource_name "$instance_type" || { log_error "Invalid GENESIS_INSTANCE_TYPE"; return 1; }
|
||||
validate_region_name "$region" || { log_error "Invalid GENESIS_REGION"; return 1; }
|
||||
# Image names may contain spaces (e.g. "Ubuntu 24.04") but must not contain quotes or shell metacharacters
|
||||
if [[ "$image" =~ [\'\"\`\$\;\\] ]]; then log_error "Invalid GENESIS_IMAGE: contains unsafe characters"; return 1; fi
|
||||
|
||||
log_warn "Creating Genesis Cloud instance '$name' (type: $instance_type, region: $region)..."
|
||||
|
||||
local ssh_key_ids
|
||||
ssh_key_ids=$(_genesis_fetch_ssh_key_ids)
|
||||
|
||||
local body
|
||||
body=$(_genesis_build_create_payload "$name" "$instance_type" "$region" "$image" "$ssh_key_ids")
|
||||
|
||||
local response
|
||||
response=$(genesis_api POST "/instances" "$body")
|
||||
|
||||
if echo "$response" | grep -q '"instance"'; then
|
||||
GENESIS_SERVER_ID=$(echo "$response" | python3 -c "import json,sys; print(json.loads(sys.stdin.read())['instance']['id'])")
|
||||
export GENESIS_SERVER_ID
|
||||
log_info "Instance created: ID=$GENESIS_SERVER_ID"
|
||||
else
|
||||
log_error "Failed to create Genesis Cloud instance"
|
||||
|
||||
local error_msg
|
||||
error_msg=$(echo "$response" | python3 -c "import json,sys; d=json.loads(sys.stdin.read()); print(d.get('error',{}).get('message', d.get('message','Unknown error')))" 2>/dev/null || echo "$response")
|
||||
log_error "API Error: $error_msg"
|
||||
|
||||
log_warn "Common issues:"
|
||||
log_warn " - Insufficient account balance"
|
||||
log_warn " - Instance type unavailable in region (try different GENESIS_INSTANCE_TYPE or GENESIS_REGION)"
|
||||
log_warn " - Instance limit reached"
|
||||
log_warn "Remediation: Check https://console.genesiscloud.com/"
|
||||
return 1
|
||||
fi
|
||||
|
||||
_genesis_wait_for_active "$GENESIS_SERVER_ID"
|
||||
}
|
||||
|
||||
verify_server_connectivity() {
|
||||
local ip="$1"
|
||||
local max_attempts=${2:-30}
|
||||
# SSH_OPTS is defined in shared/common.sh
|
||||
# shellcheck disable=SC2154
|
||||
generic_ssh_wait "root" "$ip" "$SSH_OPTS -o ConnectTimeout=5" "echo ok" "SSH connectivity" "$max_attempts" 5
|
||||
}
|
||||
|
||||
run_server() {
|
||||
local ip="$1"; local cmd="$2"
|
||||
# shellcheck disable=SC2086
|
||||
ssh $SSH_OPTS "root@$ip" "$cmd"
|
||||
}
|
||||
|
||||
upload_file() {
|
||||
local ip="$1"; local local_path="$2"; local remote_path="$3"
|
||||
# shellcheck disable=SC2086
|
||||
scp $SSH_OPTS "$local_path" "root@$ip:$remote_path"
|
||||
}
|
||||
|
||||
interactive_session() {
|
||||
local ip="$1"; local cmd="$2"
|
||||
# shellcheck disable=SC2086
|
||||
ssh -t $SSH_OPTS "root@$ip" "$cmd"
|
||||
}
|
||||
|
||||
destroy_server() {
|
||||
local server_id="$1"
|
||||
log_warn "Destroying instance $server_id..."
|
||||
genesis_api DELETE "/instances/$server_id"
|
||||
log_info "Instance $server_id destroyed"
|
||||
}
|
||||
|
||||
list_servers() {
|
||||
local response
|
||||
response=$(genesis_api GET "/instances")
|
||||
python3 -c "
|
||||
import json, sys
|
||||
data = json.loads(sys.stdin.read())
|
||||
instances = data.get('instances', [])
|
||||
if not instances:
|
||||
print('No instances found')
|
||||
sys.exit(0)
|
||||
print(f\"{'NAME':<25} {'ID':<40} {'STATUS':<12} {'IP':<16} {'TYPE':<40}\")
|
||||
print('-' * 133)
|
||||
for i in instances:
|
||||
name = i.get('name', 'N/A')
|
||||
iid = i['id']
|
||||
status = i['status']
|
||||
ip = i.get('public_ip', 'N/A')
|
||||
itype = i.get('type', 'N/A')
|
||||
print(f'{name:<25} {iid:<40} {status:<12} {ip:<16} {itype:<40}')
|
||||
" <<< "$response"
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "NanoClaw on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing tsx..."
|
||||
run_server "${GENESIS_SERVER_IP}" "source ~/.bashrc && bun install -g tsx"
|
||||
|
||||
log_warn "Cloning and building nanoclaw..."
|
||||
run_server "${GENESIS_SERVER_IP}" "git clone https://github.com/gavrielc/nanoclaw.git ~/nanoclaw && cd ~/nanoclaw && npm install && npm run build"
|
||||
log_info "NanoClaw 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_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"
|
||||
|
||||
log_warn "Configuring nanoclaw..."
|
||||
DOTENV_TEMP=$(mktemp)
|
||||
trap 'rm -f "${DOTENV_TEMP}"' EXIT
|
||||
chmod 600 "${DOTENV_TEMP}"
|
||||
cat > "${DOTENV_TEMP}" << EOF
|
||||
ANTHROPIC_API_KEY=${OPENROUTER_API_KEY}
|
||||
EOF
|
||||
|
||||
upload_file "${GENESIS_SERVER_IP}" "${DOTENV_TEMP}" "/root/nanoclaw/.env"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting nanoclaw..."
|
||||
log_warn "You will need to scan a WhatsApp QR code to authenticate."
|
||||
echo ""
|
||||
interactive_session "${GENESIS_SERVER_IP}" "cd ~/nanoclaw && source ~/.zshrc && npm run dev"
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "OpenClaw on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing openclaw..."
|
||||
run_server "${GENESIS_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
|
||||
|
||||
# Get model preference
|
||||
MODEL_ID=$(get_model_id_interactive "openrouter/auto" "Openclaw") || exit 1
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_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 ${GENESIS_SERVER_IP}" \
|
||||
"run_server ${GENESIS_SERVER_IP}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting openclaw..."
|
||||
run_server "${GENESIS_SERVER_IP}" "source ~/.zshrc && nohup openclaw gateway > /tmp/openclaw-gateway.log 2>&1 &"
|
||||
sleep 2
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && openclaw tui"
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=SC2154
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "OpenCode on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing OpenCode..."
|
||||
run_server "${GENESIS_SERVER_IP}" "curl -fsSL https://raw.githubusercontent.com/opencode-ai/opencode/refs/heads/main/install | bash"
|
||||
log_info "OpenCode 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud instance setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting OpenCode..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && opencode"
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
||||
# shellcheck source=genesiscloud/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/genesiscloud/lib/common.sh)"
|
||||
fi
|
||||
|
||||
log_info "Plandex on Genesis Cloud"
|
||||
echo ""
|
||||
|
||||
ensure_genesis_token
|
||||
ensure_ssh_key
|
||||
|
||||
SERVER_NAME=$(get_server_name)
|
||||
create_server "${SERVER_NAME}"
|
||||
verify_server_connectivity "${GENESIS_SERVER_IP}"
|
||||
wait_for_cloud_init "${GENESIS_SERVER_IP}" 60
|
||||
|
||||
log_warn "Installing Plandex..."
|
||||
run_server "${GENESIS_SERVER_IP}" "curl -sL https://plandex.ai/install.sh | bash"
|
||||
|
||||
log_warn "Verifying Plandex installation..."
|
||||
if ! run_server "${GENESIS_SERVER_IP}" "command -v plandex" >/dev/null 2>&1; then
|
||||
log_error "Plandex installation failed"
|
||||
exit 1
|
||||
fi
|
||||
log_info "Plandex is 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
|
||||
|
||||
log_warn "Setting up environment variables..."
|
||||
inject_env_vars_ssh "${GENESIS_SERVER_IP}" upload_file run_server \
|
||||
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}"
|
||||
|
||||
echo ""
|
||||
log_info "Genesis Cloud server setup completed successfully!"
|
||||
log_info "Server: ${SERVER_NAME} (ID: ${GENESIS_SERVER_ID}, IP: ${GENESIS_SERVER_IP})"
|
||||
echo ""
|
||||
|
||||
log_warn "Starting Plandex..."
|
||||
sleep 1
|
||||
clear
|
||||
interactive_session "${GENESIS_SERVER_IP}" "source ~/.zshrc && plandex"
|
||||
Loading…
Add table
Add a link
Reference in a new issue