mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-22 03:14:57 +00:00
Major refactoring to improve code maintainability and reliability: ## Shared Library Architecture - Created sprite/lib/common.sh with reusable bash functions - Reduced openclaw.sh from 258 to 93 lines (-64%) - Reduced claude.sh from 272 to 101 lines (-63%) - Eliminated ~330 lines of duplicate code ## OAuth Fallback Mechanism - Added automatic fallback to manual API key entry - Handles missing netcat (nc) gracefully - Handles port conflicts and timeouts - Validates API key format with override option - Works in headless and minimal environments ## Dual Execution Support - Local: bash sprite/openclaw.sh - Remote: curl URL | bash - Auto-detects context and sources library appropriately ## New Shared Functions - Logging: log_info(), log_warn(), log_error() - Sprite setup: ensure_sprite_installed/authenticated/exists() - Environment: setup_shell_environment() - OAuth: get_openrouter_api_key_oauth() with fallback - Utilities: run_sprite(), verify_sprite_connectivity() ## Documentation - REFACTORING.md - Architecture and benefits - OAUTH_FALLBACK.md - Fallback mechanism guide - CURL_BASH_SOLUTION.md - Execution mode details - EXAMPLES.md - Usage scenarios - CHANGELOG.md - Complete change history Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| sprite | ||
| CHANGELOG.md | ||
| CURL_BASH_SOLUTION.md | ||
| EXAMPLES.md | ||
| OAUTH_FALLBACK.md | ||
| README.md | ||
| REFACTORING.md | ||
| test_oauth_fallback.sh | ||
Spawn
Conjure your agents!
Features
- 🔐 Automatic OAuth - Seamless authentication with OpenRouter
- 🔄 Smart Fallback - Manual API key entry if OAuth fails
- 🚀 One Command Setup - Get running in minutes
- 🔧 Environment Ready - Pre-configured shell and dependencies
Usage
Claude Code Setup
Setup a sprite with Claude Code pre-configured (via OpenRouter):
curl https://openrouter.ai/lab/spawn/sprite/claude.sh | bash
OpenClaw Setup
Setup a sprite with openclaw pre-configured:
curl https://openrouter.ai/lab/spawn/sprite/openclaw.sh | bash