Backends overview
A Backend is a provider-specific implementation of the operations a Run depends on: launching a container, attaching an interactive shell, streaming logs, terminating. The CLI is written against a Backend interface so the user-facing surface stays identical across providers.
Pick one with afk init --provider <name>, or use --local per command. Each
Backend’s deep detail — what it provisions, its attach / lifecycle / cost
specifics, and teardown — lives in its own page.
| Backend | Compute primitive | Provisioning | Capacity | Retention | Notes |
|---|---|---|---|---|---|
| AWS EC2 | One EC2 VM per Run | Terraform (VPC, IAM, sweeper Lambda, DynamoDB, S3 state) | Spot by default; --on-demand available | Opt-in (--retain, On-Demand only) | Full Compose Contract; host Docker daemon |
| GCP Compute Engine | One Compute Engine VM per Run | Terraform (VPC + NAT + IAP, service accounts, Firestore, Artifact Registry, GCS state) | Spot by default; --on-demand available | Opt-in (--retain, On-Demand only) | Full Compose Contract; attach over IAP tunnel |
| Azure Virtual Machines | One Azure VM per Run | Terraform (VNet + NAT + Bastion, managed identity, ACR, Key Vault, Storage, sweeper Function) | Spot by default; --on-demand available | Opt-in (--retain, On-Demand only) | Full Compose Contract; attach through Bastion + Entra ID |
| Cloudflare Containers | One Container instance per Run | Customer-deployed launcher Worker (rootless dind) | n/a | Not possible | Requires the Workers Paid plan |
| Local | One container per Run on your own daemon | None (afk provision is a no-op) | n/a | Every Run retained | Rootless dind; needs only Docker |
What stays the same
Section titled “What stays the same”No matter the Backend, the backend-neutral commands mean the same thing:
afk run <command…>launches one Run.afk sessionlaunches an Interactive Run to attach into and drive by hand.afk lslists your Runs (--allfor team-wide, if permitted).afk attach <run-id>drops you into the main service (or a sidecar with--service, or the host with--host).afk logs <run-id>tails logs from the active Backend’s log store.afk kill <run-id>terminates the Run’s compute primitive.
See the CLI surface for the complete command reference.