> fly-io
Assists with deploying applications globally on Fly.io edge infrastructure. Use when deploying Docker-based apps, configuring multi-region machines, setting up persistent storage, or managing global databases. Trigger words: fly.io, fly deploy, fly machines, fly launch, multi-region, edge deployment, flyctl.
curl "https://skillshub.wtf/TerminalSkills/skills/fly-io?format=md"Fly.io
Overview
Fly.io deploys applications to Firecracker microVMs across 30+ edge regions worldwide, providing sub-50ms latency to users. It supports scale-to-zero machines, persistent NVMe volumes, LiteFS for multi-region SQLite replication, and private WireGuard networking between services.
Instructions
- When deploying applications, use
fly launchto auto-detect the framework and generate a Dockerfile, thenfly deployfor zero-downtime rolling updates with health checks. - When configuring scaling, use
auto_stop_machinesandauto_start_machinesinfly.tomlto scale to zero when idle and wake on incoming requests, and set machine sizing appropriate to the workload. - When managing multi-region deployments, use
fly scale count --regionto distribute machines,fly-replayheader to route writes to the primary region, and LiteFS for SQLite read replicas. - When handling persistent data, attach volumes for durable storage (machines are ephemeral), use LiteFS for multi-region SQLite, or Tigris for S3-compatible object storage.
- When connecting services, use
.internalDNS for private service-to-service communication over the WireGuard mesh and never expose internal services to the public internet. - When managing secrets, use
fly secrets set KEY=valuefor encrypted secret storage accessible as environment variables. - When troubleshooting, use
fly logsfor real-time streaming,fly ssh consoleto access running machines, andfly proxyto tunnel to internal services.
Examples
Example 1: Deploy a multi-region web application
User request: "Deploy my app globally with Fly.io in US, Europe, and Asia"
Actions:
- Initialize with
fly launchand configure Dockerfile - Deploy machines to three regions:
fly scale count 2 --region iad,cdg,nrt - Set up LiteFS for SQLite replication across regions
- Configure
fly-replayheader for write routing to the primary region
Output: A globally distributed app with read replicas in three regions and automatic write routing.
Example 2: Configure a cost-efficient staging environment
User request: "Set up a Fly.io staging environment that scales to zero when not in use"
Actions:
- Create a staging app with
fly launch - Configure
auto_stop_machines = "stop"andauto_start_machines = trueinfly.toml - Attach a volume for persistent database storage
- Set health checks with appropriate timeouts for routing
Output: A staging environment that stops idle machines and wakes in sub-second on the next request.
Example 3: Canary deployment with auto-rollback
User request: "Deploy my app to Fly.io but test on one machine first. If the health check fails, roll back."
Actions:
- Deploy with
--strategy canaryto spin up a single new machine - Health check the canary machine at the app's health endpoint
- If healthy, promote with
fly deploy --strategy rollingto replace all machines - If unhealthy, rollback with
fly releases rollback
#!/bin/bash
# deploy-canary.sh — Fly.io canary deployment with auto-rollback
set -euo pipefail
APP="${1:?Usage: deploy-canary.sh <app-name>}"
HEALTH_PATH="${2:-/api/health}"
echo "🐤 Deploying canary..."
fly deploy --app "$APP" --strategy canary --wait-timeout 120
HEALTH_URL="https://${APP}.fly.dev${HEALTH_PATH}"
HEALTHY=false
DEADLINE=$((SECONDS + 60))
while [ $SECONDS -lt $DEADLINE ]; do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$HEALTH_URL" || true)
[ "$STATUS" = "200" ] && HEALTHY=true && break
sleep 3
done
if [ "$HEALTHY" = true ]; then
echo "✅ Canary healthy! Promoting..."
fly deploy --app "$APP" --strategy rolling
echo "🎉 Production deploy complete"
else
echo "❌ Canary failed! Rolling back..."
fly releases rollback --app "$APP"
echo "⏪ Rolled back"
exit 1
fi
Guidelines
- Use
auto_stop_machines = "stop"for dev/staging to save costs; machines stop after idle timeout. - Keep
auto_start_machines = trueso machines wake on incoming requests with sub-second cold start. - Use
.internalDNS for service-to-service calls; never expose internal services publicly. - Store persistent data on volumes, not the machine filesystem, since machines are ephemeral.
- Use LiteFS for SQLite apps needing multi-region reads; it is simpler than PostgreSQL replication.
- Set health checks with realistic timeouts; Fly Proxy uses them for routing, not just monitoring.
- Use
fly-replayheader for write operations in multi-region setups to route to the primary region.
> related_skills --same-repo
> zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
> zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
> zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
> zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.