mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-06 08:10:48 +00:00
* refactor: extract shared test helpers and utilities Created centralized test-helpers.ts module to eliminate duplication across test files: **Extracted Helpers:** - createMockManifest() - Reusable mock manifest data - createEmptyManifest() - Empty manifest for edge cases - createConsoleMocks() - Console spy setup - createProcessExitMock() - Process exit mock - restoreMocks() - Mock cleanup utility - mockSuccessfulFetch() - Simplified successful fetch mock - mockFailedFetch() - Simplified failed fetch mock - mockFetchWithStatus() - Fetch mock with custom status - setupTestEnvironment() - Test directory and env setup - teardownTestEnvironment() - Cleanup utility **Deduplication Impact:** - commands.test.ts: Removed 50+ lines of duplicate mock setup - manifest.test.ts: Removed 80+ lines of duplicate manifest data and setup code - integration.test.ts: Removed 40+ lines of duplicate setup/teardown **Benefits:** - Single source of truth for test fixtures - Consistent mock patterns across all tests - Easier maintenance - changes to test setup in one place - Improved test readability Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: Add non-interactive mode for agent execution Implements --prompt and --prompt-file flags to enable non-interactive agent execution. This allows users to: - Execute agents with a prompt and exit automatically - Use spawn in CI/CD pipelines and automation scripts - Pass prompts via command line or file Changes: - TypeScript CLI: Parse --prompt/-p and --prompt-file flags - Security: Add validatePrompt() to prevent command injection - Commands: Pass prompt via SPAWN_PROMPT env var to bash scripts - Bash scripts: Detect SPAWN_PROMPT and fork interactive/non-interactive - Help text: Document new flags with examples Implementation: - claude.sh: Use 'claude -p' for non-interactive execution - aider.sh: Use 'aider -m' for non-interactive execution - shared/common.sh: Add execute_agent_non_interactive() helper Security: - Validates prompts for command injection patterns - Length limit: 10KB max - Blocks $(), backticks, piping to bash/sh - Uses printf %q for proper shell escaping Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: Add testing guide for non-interactive mode Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Sprite <noreply@sprite.dev> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .githooks | ||
| .github/workflows | ||
| aws-lightsail | ||
| civo | ||
| cli | ||
| daytona | ||
| digitalocean | ||
| e2b | ||
| fly | ||
| gcp | ||
| hetzner | ||
| lambda | ||
| linode | ||
| modal | ||
| scaleway | ||
| shared | ||
| sprite | ||
| test | ||
| vultr | ||
| .shellcheckrc | ||
| CLAUDE.md | ||
| improve.sh | ||
| manifest.json | ||
| README.md | ||
| SECURITY_AUDIT.md | ||
| TESTING_NON_INTERACTIVE.md | ||
Spawn
Launch any agent on any cloud, powered by OpenRouter.
Install
curl -fsSL https://openrouter.ai/lab/spawn/cli/install.sh | bash
Usage
spawn # Interactive picker
spawn <agent> <cloud> # Launch directly
spawn list # Show the full matrix
Examples
spawn claude sprite # Claude Code on Sprite
spawn aider hetzner # Aider on Hetzner Cloud
spawn goose digitalocean # Goose on DigitalOcean
spawn codex vultr # Codex CLI on Vultr
Commands
| Command | Description |
|---|---|
spawn |
Interactive agent + cloud picker |
spawn <agent> <cloud> |
Launch agent on cloud directly |
spawn <agent> |
Show available clouds for an agent |
spawn list |
Full agent x cloud matrix |
spawn agents |
List all agents |
spawn clouds |
List all cloud providers |
Without the CLI
Every combination also works as a one-liner:
bash <(curl -fsSL https://openrouter.ai/lab/spawn/{cloud}/{agent}.sh)
Non-Interactive
Skip all prompts with environment variables:
OPENROUTER_API_KEY=sk-or-v1-xxxxx \
spawn claude sprite
Each cloud has its own env vars for auth — see the cloud's README.
Matrix
| Sprite | Hetzner | DigitalOcean | Vultr | Linode | Lambda | Lightsail | GCP | E2B | Modal | Fly.io | Civo | Scaleway | Daytona | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Claude Code | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| OpenClaw | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| NanoClaw | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Aider | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Goose | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Codex CLI | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Interpreter | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Gemini CLI | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Amazon Q | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Cline | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gptme | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| OpenCode | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Development
git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks