spawn/sh/fly
A 65f6f1be32
feat: Bun workspace monorepo — packages/cli + packages/shared (#1853)
Restructure the repo as a Bun workspace monorepo:

- Move cli/ → packages/cli/
- Create packages/shared/ (@openrouter/spawn-shared) with type-guards and parse utilities
- Add root package.json with workspace configuration
- Update all CLI imports to use @openrouter/spawn-shared
- Deduplicate toRecord/toObjectArray helpers from 4 cloud modules
- Update SPA (slack-bot) to use shared package instead of local toObj()
- Update 48 agent shell scripts for new packages/cli/ path
- Update install.sh, install.ps1, e2e, and test scripts
- Update all GitHub workflows, .gitignore, pre-commit hooks
- Update CLAUDE.md, README.md, and skill prompt references
- Pin all dependency versions (no ^ ranges)
- Bump CLI version 0.9.1 → 0.10.0

All 1908 tests pass. Lint clean. All 8 cloud bundles build.

Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-23 22:07:05 -08:00
..
docker refactor: move all shell scripts to /sh directory (#1843) 2026-02-23 21:14:54 -08:00
claude.sh feat: Bun workspace monorepo — packages/cli + packages/shared (#1853) 2026-02-23 22:07:05 -08:00
codex.sh feat: Bun workspace monorepo — packages/cli + packages/shared (#1853) 2026-02-23 22:07:05 -08:00
kilocode.sh feat: Bun workspace monorepo — packages/cli + packages/shared (#1853) 2026-02-23 22:07:05 -08:00
openclaw.sh feat: Bun workspace monorepo — packages/cli + packages/shared (#1853) 2026-02-23 22:07:05 -08:00
opencode.sh feat: Bun workspace monorepo — packages/cli + packages/shared (#1853) 2026-02-23 22:07:05 -08:00
README.md refactor: move all shell scripts to /sh directory (#1843) 2026-02-23 21:14:54 -08:00
zeroclaw.sh feat: Bun workspace monorepo — packages/cli + packages/shared (#1853) 2026-02-23 22:07:05 -08:00

Fly.io

Fly.io Machines via REST API and flyctl CLI. Fly.io

Architecture

The Fly.io provider is implemented in TypeScript (Bun runtime). Each .sh agent script is a thin shim that ensures bun is installed, downloads the TS sources if running via bash <(curl ...), and delegates to main.ts.

fly/
  main.ts               # Orchestrator: auth → provision → install → launch
  lib/
    fly.ts              # Core provider: API client, auth, orgs, provisioning
    agents.ts           # Agent configs (all 6) + shared install/config helpers
    oauth.ts            # OpenRouter OAuth flow (Bun.serve), key validation
    ui.ts               # Logging (ANSI), prompts (readline), browser open
  {agent}.sh            # Thin bash shim → bun run main.ts {agent}

No external dependencies — all modules use built-in Bun/Node APIs only. The fly/ directory has no package.json.

Agents

Claude Code

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

OpenClaw

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

ZeroClaw

bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/zeroclaw.sh)

Codex CLI

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

OpenCode

bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/opencode.sh)

Kilo Code

bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/kilocode.sh)

Non-Interactive Mode

FLY_APP_NAME=dev-mk1 \
FLY_API_TOKEN=your-token \
OPENROUTER_API_KEY=sk-or-v1-xxxxx \
  bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/claude.sh)

Environment Variables

Variable Description Default
FLY_API_TOKEN Fly.io API token (prompted or from flyctl auth)
FLY_APP_NAME App name (prompted)
FLY_REGION Deployment region iad
FLY_VM_SIZE VM size shared-cpu-1x
FLY_VM_MEMORY VM memory (MB) 1024
FLY_ORG Organization slug personal
OPENROUTER_API_KEY OpenRouter API key (OAuth or prompted)