Skip to content
← Public packages

@kentcdodds/fly

Manage Fly.io apps, Machines, logs, and metrics.

README.md

34 lines · 1.3 KB · Markdown

@kentcdodds/fly

Intent

Fly.io helpers for organizations, apps, Machines, logs, and Prometheus metrics in Kody workflows. Apps and Machines listing use an OpenAPI-scaffolded Machines REST client; GraphQL and Prometheus helpers stay available for orgs, custom queries, logs, and metrics.

What it does

  • List Fly organizations, apps, and Machines (org-wide or per app)
  • Count Machines grouped by state and app for capacity checks
  • Fetch app logs for an outage window with summarized incident signals
  • Query Fly Prometheus metrics (CPU, memory, disk, HTTP) or custom PromQL
  • Run custom Fly GraphQL queries against api.fly.io

Prerequisites / setup

  1. Save a Fly API token in Kody as user secret flyApiToken (never paste the value in chat).
  2. Approve hosts api.machines.dev (Machines REST) and api.fly.io (GraphQL, logs, Prometheus) for that secret as needed.
  3. Agents: see AGENTS.md for import paths and smoke checks.

Machines REST uses Authorization: Bearer with the secret. GraphQL / logs / Prometheus keep their existing Fly auth headers (Bearer / FlyV1).

Done when

  • flyApiToken is saved and hosts are approved
  • Read-only smoke test returns ok: true with org/app (and optional machine) samples
  • You can list apps/machines and pull logs or metrics for a real app when needed