diff --git a/fluidstack/interpreter.sh b/fluidstack/interpreter.sh new file mode 100644 index 00000000..09a283d5 --- /dev/null +++ b/fluidstack/interpreter.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# shellcheck disable=SC2154 +set -eo pipefail + +# Source common functions - try local file first, fall back to remote +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)" +# shellcheck source=fluidstack/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/fluidstack/lib/common.sh)" +fi + +log_info "Open Interpreter on FluidStack" +echo "" + +# 1. Ensure FluidStack API key is configured +ensure_fluidstack_token + +# 2. Generate + register SSH key +ensure_ssh_key + +# 3. Get instance name and create instance +SERVER_NAME=$(get_server_name) +create_server "${SERVER_NAME}" + +# 4. Wait for SSH connectivity and install base tools +verify_server_connectivity +install_base_tools + +# 5. Install Open Interpreter +log_warn "Installing Open Interpreter..." +run_server "${FLUIDSTACK_SERVER_IP}" "pip install open-interpreter 2>/dev/null || pip3 install open-interpreter" + +# 6. Get OpenRouter API key +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 + +# 7. Inject environment variables +log_warn "Setting up environment variables..." +inject_env_vars_ssh "${FLUIDSTACK_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 "FluidStack instance setup completed successfully!" +log_info "Instance: ${SERVER_NAME} (IP: ${FLUIDSTACK_SERVER_IP})" +echo "" + +# 8. Start Open Interpreter interactively +log_warn "Starting Open Interpreter..." +sleep 1 +clear +interactive_session "${FLUIDSTACK_SERVER_IP}" "source ~/.zshrc && interpreter" diff --git a/manifest.json b/manifest.json index 00ec9dc4..db0191bc 100644 --- a/manifest.json +++ b/manifest.json @@ -820,7 +820,7 @@ "fluidstack/aider": "implemented", "fluidstack/goose": "implemented", "fluidstack/codex": "implemented", - "fluidstack/interpreter": "missing", + "fluidstack/interpreter": "implemented", "fluidstack/gemini": "missing", "fluidstack/amazonq": "missing", "fluidstack/cline": "missing",