spawn/fly
A a1a1ae85dc
refactor: replace python3 with bun+TS in fly/lib/common.sh (#1596)
* refactor: replace python3 with bun+TS in fly/lib/common.sh, fix token validation

Three targeted fixes to the Fly.io library:

1. Replace all python3 with bun+TypeScript:
   - _fly_json: stdin-piped field extractor via bun -e (no eval, no env var
     size limits — handles arbitrarily large API responses)
   - _fly_json_ids: dedicated machine ID extractor for destroy_server
   - _fly_list_orgs: bun -e with flat dict + nodes/organizations support
   - list_servers: bun -e formatted table output
   Zero python3 invocations remain in the file.

2. Dual-endpoint _test_fly_token: tries Machines API first (deploy tokens),
   falls back to api.fly.io/v1/user (OAuth/personal tokens). Prevents
   rejecting valid personal tokens that lack Machines API access.

3. No more eval(): _fly_json uses direct property access (d[field]) instead
   of python3 eval(expr), eliminating the code injection surface entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: always prompt user for Fly.io org, never silently default

_fly_prompt_org now asks the user directly when the org list can't be
fetched, instead of silently falling back to "personal".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: lab <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-21 08:56:24 -08:00
..
lib refactor: replace python3 with bun+TS in fly/lib/common.sh (#1596) 2026-02-21 08:56:24 -08:00
claude.sh fix: use ~/.spawnrc for env vars instead of inlining into .bashrc (#1362) 2026-02-16 17:05:17 -08:00
codex.sh fix: source .spawnrc directly in agent launch commands for reliable env loading (#1546) 2026-02-20 23:37:03 -05:00
kilocode.sh fix: source .spawnrc directly in agent launch commands for reliable env loading (#1546) 2026-02-20 23:37:03 -05:00
openclaw.sh fix: source .spawnrc directly in agent launch commands for reliable env loading (#1546) 2026-02-20 23:37:03 -05:00
opencode.sh fix: source .spawnrc directly in agent launch commands for reliable env loading (#1546) 2026-02-20 23:37:03 -05:00
README.md fix: sync cloud READMEs with current agent list (#1486) 2026-02-19 17:47:57 -05:00
zeroclaw.sh feat: reorder agents and remove NanoClaw (#1477) 2026-02-19 11:39:03 -08:00

Fly.io

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

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)