mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-06 08:10:48 +00:00
Replace the prompt-first auth flow with a browser-based CLI session flow (same as `fly auth login`). The new auth chain is: 1. Environment variable (FLY_API_TOKEN) 2. Saved config file (~/.config/spawn/fly.json) 3. flyctl CLI (`fly auth token`) 4. Browser OAuth via Fly.io CLI Sessions API (NEW) 5. Manual token prompt (last resort fallback) The browser flow creates a CLI session via POST /api/v1/cli_sessions, opens the auth URL in the user's browser, then polls for the access token. This is the same mechanism flyctl uses internally. Also add _sanitize_fly_token() to handle the Fly dashboard copy button which includes the display name before the token (e.g. "Deploy Token FlyV1 fm2_..."). The sanitizer strips everything before "FlyV1" or extracts bare "fm2_" tokens, and trims whitespace/newlines. Applied at every token entry point (env var, config, manual prompt). Co-authored-by: lab <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| lib | ||
| claude.sh | ||
| codex.sh | ||
| kilocode.sh | ||
| openclaw.sh | ||
| opencode.sh | ||
| README.md | ||
| zeroclaw.sh | ||
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) |