Fly.io CLI
by @justinburdett
Use the Fly.io flyctl CLI for deploying and operating apps on Fly.io. Default to read-only diagnostics (status/logs/config/releases). Only perform state-changing operations (deploys, SSH exec, secrets, scaling, machines, volumes, Postgres changes) with explicit user approval. Use when asked to deploy to Fly.io, debug fly deploy/build/runtime failures, set up GitHub Actions deploys/previews, or safely manage Fly apps and Postgres.
clawhub install flyio-cli📖 About This Skill
name: flyio-cli description: "Use the Fly.io flyctl CLI for deploying and operating apps on Fly.io. Default to read-only diagnostics (status/logs/config/releases). Only perform state-changing operations (deploys, SSH exec, secrets, scaling, machines, volumes, Postgres changes) with explicit user approval. Use when asked to deploy to Fly.io, debug fly deploy/build/runtime failures, set up GitHub Actions deploys/previews, or safely manage Fly apps and Postgres."
Fly.io (flyctl) CLI
Operate Fly.io apps safely and repeatably with flyctl.
Defaults / safety
fly status, fly logs, fly config show, fly releases, fly secrets list.Quick start (typical deploy)
From the app repo directory:
1) Confirm which app you’re targeting
fly app listfly status -a fly.toml for app = "..."2) Validate / inspect (read-only)
fly status -a fly logs -a fly config show -a (Deploys are in High-risk operations below and require explicit user approval.)
Debugging deploy/build failures
Common checks
fly deploy --verbose (more build logs)Rails + Docker + native gems (nokogiri, pg, etc.)
Symptoms: Bundler can’t find a platform gem likenokogiri-…-x86_64-linux during build.Fix pattern:
Gemfile.lock includes the Linux platform used by Fly’s builder (usually x86_64-linux).bundle lock --add-platform x86_64-linux
.ruby-version.(See references/rails-docker-builds.md.)
Logs & config (read-only)
fly logs -a
fly config show -a
fly secrets list -a High-risk operations (ask first)
These commands can execute arbitrary code on servers or mutate production state. Only run them when the user explicitly asks you to.
fly deploy / fly deploy --remote-only
fly ssh console -a -C ""
fly secrets set -a KEY=value See references/safety.md.
Fly Postgres basics
Identify the Postgres app
fly postgres listAttach Postgres to an app
fly postgres attach -a Create a database inside the cluster
fly postgres db create -a fly postgres db list -a Connect (psql)
fly postgres connect -a GitHub Actions deploys / previews
superfly/flyctl-actions/setup-flyctl) and run flyctl deploy.(See references/github-actions.md.)
Bundled resources
references/safety.md: safety rules (read-only by default; ask before mutating state).references/rails-docker-builds.md: Rails/Docker/Fly build failure patterns + fixes.references/github-actions.md: Fly deploy + preview workflows.scripts/fly_app_from_toml.sh: tiny helper to print the Fly app name from fly.toml (shell-only; no ruby).