Fly

From intentic/intentic · View interactive version

Fly is an AI agent skill from the GitHub repository intentic/intentic. Manage Fly.io machines, apps, volumes and app secrets through the Machines API. Use when the user asks what is running on Fly.io, or to start, stop, resize, move, redeploy or destroy a Fly machine.

How to use this skill

Skill file

Fly.io (connected)

Token in $FLY_API_TOKEN, organization slug in $FLY_ORG. Everything below is the Machines API at

$FLY_MACHINES_URL/v1 (it stands in for https://api.machines.dev/v1); flyctl is not installed here, and a copy

you install yourself reads the plain name, so hand it the token per command:

FLY_API_TOKEN=$FLY_API_TOKEN fly status -a <APP>. flyctl needs the real token, so it works only when the owner set

this card to raw delivery; prefer flyapi. Define this helper once per shell: flyapi <METHOD> <path> [-d '<json>']:

flyapi() { local m="$1" p="$2"; shift 2; curl -s -X "$m" -H "Authorization: Bearer $FLY_API_TOKEN" \
  -H "Content-Type: application/json" "$FLY_MACHINES_URL/v1/$p" "$@"; }

The machine is the unit: an app is a namespace with its own private network, and scaling means creating or

destroying machines inside one. A failure answers non-2xx with {"error": "…"}, so read .error rather than

assuming the shape of the result: 404 is definitively gone, 401/403 is a token that never covered this, and an

app-scoped token refuses org-wide calls outright instead of answering an empty list.

Reading

Changing what runs

Each of these costs money or takes traffic. Say which machines you are about to touch before running one, and

report what came back.

Deploying a new build

There is no fly deploy from here; a deploy is push an image, then point machines at it. Mint an app-scoped

registry credential with flyapi POST apps/<APP>/deploy_token -d '{"expiry":"1h"}', `docker login

registry.fly.io -u x -p <token>, push registry.fly.io/<APP>:<tag>` (needs the Docker capability in this

sandbox), then update each machine's config.image and wait for started one machine at a time. With no

Docker, deploy an image that already sits in a registry Fly can pull.

Notes: a started machine bills for its CPU and RAM every second it is up; a stopped or suspended one bills only

for its volume, so stop what you finished with rather than leaving it idle. States run created → starting →

started → stopping → stopped (plus suspended, replacing, destroying, destroyed), and only the

machine's own events explain a stop you did not ask for. When you are making a series of edits to one machine,

hold POST apps/<APP>/machines/<ID>/lease -d '{"ttl":60}' and release it after: a conflict means another writer

(often someone's fly deploy) holds it, and forcing past that is how two writers half-apply two configs.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.