Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - rigbox-dev/spawn: Spawn any agent, on any cloud · GitHub
Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - rigbox-dev/spawn: Spawn any agent, on any cloud · GitHub
Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - rigbox-dev/spawn: Spawn any agent, on any cloud · GitHub
Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - rigbox-dev/spawn: Spawn any agent, on any cloud · GitHub
Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - rigbox-dev/spawn: Spawn any agent, on any cloud · GitHub
Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - rigbox-dev/spawn: Spawn any agent, on any cloud · GitHub
Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - rigbox-dev/spawn: Spawn any agent, on any cloud · GitHub
Skip to content

Repository files navigation

Spawn

Launch any AI agent on any cloud with a single command. Coding agents, research agents, self-hosted AI tools — Spawn deploys them all. All models powered by OpenRouter. (ALPHA software, use at your own risk!)

10 agents. 8 clouds. 66 working combinations. Zero config.

Requirements

  • bun >= 1.2.0 (auto-installed by the spawn installer)
  • rig >= 0.6.8 (required only if using Sprite or Rigbox cloud; auto-installed on first use, or manually: curl -fsSL https://rigbox.dev/install.sh | sh)

Set SPAWN_NON_INTERACTIVE=1 to require a pre-installed rig (disable auto-install).

Install

macOS / Linux — and Windows users inside a WSL2 terminal (Ubuntu, Debian, etc.):

curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash

Windows PowerShell (outside WSL):

irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

Usage

spawn # Interactive picker
spawn <agent><cloud># Launch directly
spawn matrix # Show the full agent x cloud matrix

Examples

spawn # Interactive picker
spawn claude sprite # Claude Code on Sprite
spawn codex hetzner # Codex CLI on Hetzner
spawn claude sprite --prompt "Fix bugs"# Non-interactive with prompt
spawn codex sprite -p "Add tests"# Short form
spawn claude # Show clouds available for Claude
spawn delete # Delete a running server
spawn delete -c hetzner # Delete a server on Hetzner

Commands

CommandDescription
spawnInteractive agent + cloud picker
spawn <agent> <cloud>Launch agent on cloud directly
spawn <agent> <cloud> --dry-runPreview without provisioning
spawn <agent> <cloud> --zone <zone>Set zone/region for the cloud
spawn <agent> <cloud> --size <type>Set instance size/type for the cloud
spawn <agent> <cloud> --prompt "text"Non-interactive with prompt (or -p)
spawn <agent> <cloud> --prompt-file <file>Prompt from file (or -f)
spawn <agent> <cloud> --headlessProvision and exit (no interactive session)
spawn <agent> <cloud> --output jsonHeadless mode with structured JSON on stdout
spawn <agent> <cloud> --model <id>Set the model ID (overrides agent default)
spawn <agent> <cloud> --config <file>Load options from a JSON config file
spawn <agent> <cloud> --steps <list>Comma-separated setup steps to enable
spawn <agent> <cloud> --customShow interactive size/region pickers
spawn <agent>Show available clouds for an agent
spawn <cloud>Show available agents for a cloud
spawn matrixFull agent x cloud matrix
spawn listBrowse and rerun previous spawns
spawn list <filter>Filter history by agent or cloud name
spawn list -a <agent>Filter history by agent
spawn list -c <cloud>Filter history by cloud
spawn list --flatShow flat list (disable tree view)
spawn list --jsonOutput history as JSON
spawn list --clearClear all spawn history
spawn treeShow recursive spawn tree (parent/child relationships)
spawn tree --jsonOutput spawn tree as JSON
spawn history exportDump history as JSON to stdout (used by parent VMs)
spawn fixRe-run agent setup on an existing VM (re-inject credentials, reinstall)
spawn fix <spawn-id>Fix a specific spawn by name or ID
spawn link <ip>Register an existing VM by IP
spawn link <ip> --agent <agent>Specify the agent running on the VM
spawn link <ip> --cloud <cloud>Specify the cloud provider
spawn lastInstantly rerun the most recent spawn
spawn agentsList all agents with descriptions
spawn cloudsList all cloud providers
spawn feedback "message"Send feedback to the Spawn team
spawn uninstallUninstall spawn CLI and optionally remove data
spawn updateCheck for CLI updates
spawn deleteInteractively select and destroy a cloud server
spawn delete -a <agent>Filter servers to delete by agent
spawn delete -c <cloud>Filter servers to delete by cloud
spawn delete --name <name> --yesHeadless delete by name (no prompts)
spawn statusShow live state of cloud servers
spawn status -a <agent>Filter status by agent
spawn status -c <cloud>Filter status by cloud
spawn status --pruneRemove gone servers from history
spawn helpShow help message
spawn versionShow version

Config File

The --config flag loads options from a JSON file. CLI flags override config values.

{
"model": "openai/gpt-5.3-codex",
"steps": ["github", "browser", "telegram"],
"name": "my-dev-box",
"setup": {
"telegram_bot_token": "123456:ABC-DEF...",
"github_token": "ghp_xxxx"
}
}
spawn codex gcp --config setup.json --headless --output json

Setup Steps

Control which optional setup steps run with --steps:

spawn openclaw gcp --steps github,browser # Only GitHub + Chrome
spawn claude gcp --steps ""# Skip all optional steps

Available steps vary by agent:

StepAgentsDescription
githubAllGitHub CLI + git identity
reuse-api-keyAllReuse saved OpenRouter key
browseropenclawChrome browser (~400 MB)
telegramopenclawTelegram bot (set TELEGRAM_BOT_TOKEN for non-interactive)
whatsappopenclawWhatsApp linking (interactive QR scan, skipped in headless)

Fast Mode

Use --fast for significantly faster deploys. Enables all speed optimizations:

spawn claude hetzner --fast

What --fast does:

  • Parallel boot: server creation runs concurrently with API key prompt and account checks
  • Tarballs: installs agents from pre-built tarballs instead of live install
  • Skip cloud-init: for lightweight agents (Claude, OpenCode, Hermes), skips the package install wait since the base OS already has what's needed
  • Snapshots: uses pre-built cloud images when available (Hetzner, DigitalOcean)

Beta Features

Individual optimizations can be enabled separately with --beta <feature>. The flag is repeatable:

spawn claude gcp --beta tarball --beta parallel
FeatureDescription
tarballUse pre-built tarball for agent install (faster, skips live install)
imagesUse pre-built cloud images/snapshots (faster boot)
parallelParallelize server boot with setup prompts
recursiveInstall spawn CLI on VM so it can spawn child VMs
sandboxRun local agents in a Docker container (sandboxed)

--fast enables tarball, images, and parallel (not recursive or sandbox).

Recursive Spawn

Use --beta recursive to let spawned VMs create their own child VMs:

spawn claude hetzner --beta recursive

What this does:

  • Installs spawn CLI on the remote VM
  • Delegates credentials (cloud + OpenRouter) so child VMs can authenticate
  • Injects parent tracking (SPAWN_PARENT_ID, SPAWN_DEPTH) into the VM environment
  • Passes --beta recursive to children so they can also spawn recursively

View the spawn tree:

spawn tree
# spawn-abc Claude Code / Hetzner 2m ago# ├─ spawn-def Codex CLI / Hetzner 1m ago# └─ spawn-ghi OpenClaw / Hetzner 30s ago# └─ spawn-jkl Claude Code / Hetzner 10s ago

Tear down an entire tree:

spawn delete --cascade <id># Delete a VM and all its children

Sandboxed Local

Use --beta sandbox to run local agents inside a Docker container instead of directly on your machine:

spawn claude local --beta sandbox

What this does:

  • Pulls the agent's Docker image from ghcr.io/openrouterteam/spawn-<agent>
  • Runs the agent in a container with filesystem, network, and process isolation
  • Auto-installs Docker if not present (OrbStack on macOS, docker.io on Linux)
  • Cleans up the container automatically when the session ends

In the interactive picker, --beta sandbox adds a "Local Machine (Sandboxed)" option alongside the regular "Local Machine":

spawn --beta sandbox # Interactive picker shows both local options
spawn openclaw local --beta sandbox # Direct launch, sandboxed

Without the CLI

Every combination works as a one-liner — no install required:

bash <(curl -fsSL https://openrouter.ai/labs/spawn/{cloud}/{agent}.sh)

Non-Interactive Mode

Skip prompts by providing environment variables:

# OpenRouter API key (required for all agents)export OPENROUTER_API_KEY=sk-or-v1-xxxxx
# Cloud-specific credentials (varies by provider)# Note: Sprite uses `sprite login` for authenticationexport HCLOUD_TOKEN=... # For Hetznerexport DIGITALOCEAN_ACCESS_TOKEN=... # For DigitalOcean# Run non-interactively
spawn claude hetzner

You can also use inline environment variables:

OPENROUTER_API_KEY=sk-or-v1-xxxxx spawn claude sprite

Get your OpenRouter API key at: https://openrouter.ai/settings/keys

For cloud-specific auth, see each cloud's README in this repository.

Auth Reuse

If you've run rig login previously (e.g., on Sprite or Rigbox cloud), spawn picks up your rigbox session automatically from ~/.config/rigbox/config.json (XDG config directory). Spawn calls rig whoami to detect login state and only triggers rig login when needed. No second login required.

Troubleshooting

Installation issues

If spawn fails to install, try these steps:

  1. Check bun version: spawn requires bun >= 1.2.0

    bun --version
    bun upgrade # if needed
  2. Manual installation: If auto-install fails, install bun first

    curl -fsSL https://bun.sh/install | bash
    source~/.bashrc # or ~/.zshrc for zsh
    curl -fsSL https://openrouter.ai/labs/spawn/cli/install.sh | bash
  3. PATH issues: If spawn command not found after install

    # Add to your shell config (~/.bashrc or ~/.zshrc)export PATH="$HOME/.local/bin:$PATH"

Windows (PowerShell)

  1. Use the PowerShell installer — not the bash one:

    irm https://openrouter.ai/labs/spawn/cli/install.ps1 | iex

    The .ps1 extension is required. The default install.sh is bash and won't work in PowerShell.

  2. Set credentials via environment variables before launching:

    $env:OPENROUTER_API_KEY="sk-or-v1-xxxxx"$env:DIGITALOCEAN_ACCESS_TOKEN="dop_v1_xxxxx"# For DigitalOcean$env:HCLOUD_TOKEN="xxxxx"# For Hetzner
    spawn openclaw digitalocean
  3. Local build failures during auto-update are normal on Windows — the CLI falls back to a pre-built binary automatically. You may see a brief build error followed by a successful update.

  4. EISDIR or EEXIST errors on config files: If you see errors about digitalocean.json being a directory, delete it:

    Remove-Item-Recurse -Force "$HOME\.config\spawn\digitalocean.json"-ErrorAction SilentlyContinue
    spawn openclaw digitalocean

Headless JSON mode — agent exits immediately

When using --headless --output json with Claude Code, you must also pass --prompt (or -p). Without it, Claude exits with Input must be provided through stdin or --prompt and the JSON output will show "status":"error":

# WRONG — Claude exits immediately
spawn claude gcp --headless --output json
# RIGHT — provide a prompt
spawn claude gcp --headless --output json --prompt "Fix all linter errors"

Note: auto-update messages may appear before the JSON on older CLI versions. Run spawn update to get the fix.

Agent launch failures

If an agent fails to install or launch on a cloud:

  1. Check credentials: Ensure cloud provider credentials are set

    # Example for Hetznerexport HCLOUD_TOKEN=your-token-here
    spawn claude hetzner
  2. Try a different cloud: Some clouds may have temporary issues

    spawn <agent># Interactive picker to choose another cloud
  3. Use --dry-run: Preview what spawn will do before provisioning

    spawn claude hetzner --dry-run
  4. Check cloud status: Visit your cloud provider's status page

    • Many failures are transient (network timeouts, package mirror issues)
    • Retrying often succeeds

Getting help

  • View command history: spawn list shows all previous launches
  • Rerun last session: spawn last or spawn rerun
  • Check version: spawn version shows CLI version and cache status
  • Update spawn: spawn update checks for the latest version
  • Report bugs: Open an issue at https://github.com/OpenRouterTeam/spawn/issues

Matrix

Local MachineHetzner CloudAWS LightsailDigitalOceanGCP Compute EngineDaytonaSprite
Claude Code
OpenClaw
Codex CLI
OpenCode
Kilo Code
Hermes Agent
Junie
Cursor CLI
Pi

How it works

Each cell in the matrix is a self-contained bash script that:

  1. Provisions a server on the cloud provider
  2. Installs the agent
  3. Injects your OpenRouter API key so every agent uses the same billing
  4. Drops you into an interactive session

Scripts work standalone (bash <(curl ...)) or through the CLI.

Development

git clone https://github.com/OpenRouterTeam/spawn.git
cd spawn
git config core.hooksPath .githooks

Structure

sh/{cloud}/{agent}.sh # Agent deployment script (thin bash → bun wrapper)
packages/cli/ # TypeScript CLI — all provisioning logic (bun)
manifest.json # Source of truth for the matrix

Adding a new cloud

  1. Add cloud-specific TypeScript module in packages/cli/src/{cloud}/
  2. Add to manifest.json
  3. Implement agent scripts
  4. See CLAUDE.md for full contributor guide

Adding a new agent

  1. Add to manifest.json
  2. Implement on 1+ cloud by adapting an existing agent script
  3. Must support OpenRouter via env var injection

Contributing

The easiest way to contribute is by testing and reporting issues. You don't need to write code.

Test a cloud provider

Pick any agent + cloud combination from the matrix and try it out:

spawn claude hetzner # or any combination

If something breaks, hangs, or behaves unexpectedly, open an issue using the bug report template. Include:

  • The exact command you ran
  • The cloud provider and agent
  • What happened vs. what you expected
  • Any error output

Request a cloud or agent

Want to see a specific cloud provider or agent supported? Use the dedicated templates:

Requests with real-world use cases get prioritized.

Report auth or credential issues

Cloud provider APIs change frequently. If you hit authentication failures, expired tokens, or permission errors on a provider that previously worked, please report it — these are high-priority fixes.

Code contributions

See CLAUDE.md for the full contributor guide covering shell script rules, testing, and the shared library pattern.

License

Apache 2.0

About

Spawn any agent, on any cloud

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages