spawn/sh/fly/README.md
A b84adfb74e
refactor: move all shell scripts to /sh directory (#1843)
Reorganizes the project so all shell scripts live under a dedicated
/sh directory, enabling the OpenRouter rewrite URL to point at /sh/
instead of the repository root.

Moves:
- cli/install.sh → sh/cli/install.sh
- shared/*.sh → sh/shared/*.sh
- {cloud}/{agent}.sh → sh/{cloud}/{agent}.sh (48 scripts)
- {cloud}/README.md → sh/{cloud}/README.md
- e2e/*.sh → sh/e2e/*.sh
- test/macos-compat.sh → sh/test/macos-compat.sh
- test/fixtures/**/*.sh → sh/test/fixtures/**/*.sh

Updates all references:
- RAW_BASE path construction in commands.ts, update-check.ts
- GitHub auth URL in agent-setup.ts
- Self-referencing URLs in install.sh, github-auth.sh
- CI workflow paths in lint.yml, cli-release.yml
- Test file paths in install-script-validation, manifest-integrity
- Documentation in README.md, cli/README.md, CLAUDE.md
- QA scripts in .claude/skills/

Co-authored-by: lab <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-23 21:14:54 -08:00

82 lines
2.1 KiB
Markdown

# Fly.io
Fly.io Machines via REST API and flyctl CLI. [Fly.io](https://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
bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/claude.sh)
```
#### OpenClaw
```bash
bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/openclaw.sh)
```
#### ZeroClaw
```bash
bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/zeroclaw.sh)
```
#### Codex CLI
```bash
bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/codex.sh)
```
#### OpenCode
```bash
bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/opencode.sh)
```
#### Kilo Code
```bash
bash <(curl -fsSL https://openrouter.ai/labs/spawn/fly/kilocode.sh)
```
## Non-Interactive Mode
```bash
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)_ |