spawn/lambda
Sprite a9818001da refactor: migrate 5 cloud libraries to shared/common.sh pattern
Migrated aws-lightsail, e2b, gcp, lambda, and modal libraries to use
the shared library pattern established in earlier refactoring rounds.

Changes:
- Added shared/common.sh sourcing block (local-first, remote-fallback)
- Added bash safety flags (set -eo pipefail) to all 5 libraries
- Removed duplicate provider-agnostic functions:
  - Logging (log_info, log_warn, log_error)
  - Input handling (safe_read)
  - OAuth flow (try_oauth_flow, get_openrouter_api_key_oauth)
  - SSH helpers (generate_ssh_key_if_missing, etc.)
- Retained cloud-specific functions:
  - API wrappers and CLI integration
  - Server provisioning and lifecycle management
  - Cloud-specific validation and configuration

Impact:
- Net reduction: 460 lines (-545 added +85)
- Eliminates code duplication across 5 providers
- Improves consistency and maintainability
- All libraries now follow the same architectural pattern

Task: #3 (score 56 - highest priority)
Also addresses Task #4 (bash safety flags)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 01:08:34 +00:00
..
lib refactor: migrate 5 cloud libraries to shared/common.sh pattern 2026-02-08 01:08:34 +00:00
aider.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
amazonq.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
claude.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
cline.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
codex.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
gemini.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
goose.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
interpreter.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
nanoclaw.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
openclaw.sh Use ${VAR:-} for all optional env var checks (#28) 2026-02-07 16:28:12 -08:00
README.md Add E2B + Modal sandbox providers, restructure README (#22) 2026-02-07 14:11:04 -08:00

Lambda Cloud

Lambda GPU Cloud instances via REST API. Lambda Cloud

GPU cloud, uses 'ubuntu' user. Manual tool install (no cloud-init).

Agents

Claude Code

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/claude.sh)

OpenClaw

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/openclaw.sh)

NanoClaw

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/nanoclaw.sh)

Aider

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/aider.sh)

Goose

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/goose.sh)

Codex CLI

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/codex.sh)

Open Interpreter

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/interpreter.sh)

Gemini CLI

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/gemini.sh)

Amazon Q CLI

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/amazonq.sh)

Cline

bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/cline.sh)

Non-Interactive Mode

LAMBDA_SERVER_NAME=dev-mk1 \
LAMBDA_API_KEY=your-key \
OPENROUTER_API_KEY=sk-or-v1-xxxxx \
  bash <(curl -fsSL https://openrouter.ai/lab/spawn/lambda/claude.sh)