Fly.io CLI
/install flyio-cli
Fly.io (flyctl) CLI
Operate Fly.io apps safely and repeatably with flyctl.
Defaults / safety
- Prefer read-only commands first:
fly status,fly logs,fly config show,fly releases,fly secrets list. - Do not edit/modify Fly.io apps, machines, secrets, volumes, or databases without your human’s explicit approval.
- Read-only actions are OK without approval.
- Destructive actions (destroy/drop) always require explicit approval.
- When debugging builds, capture the exact error output and determine whether it’s a:
- build/packaging issue (Dockerfile, Gemfile.lock platforms, assets precompile)
- runtime issue (secrets, DB, migrations)
- platform issue (regions, machines, health checks)
Quick start (typical deploy)
From the app repo directory:
- Confirm which app you’re targeting
fly app listfly status -a \x3Capp>- Check
fly.tomlforapp = "..."
- Validate / inspect (read-only)
fly status -a \x3Capp>fly logs -a \x3Capp>fly config show -a \x3Capp>
(Deploys are in High-risk operations below and require explicit user approval.)
Debugging deploy/build failures
Common checks
fly deploy --verbose(more build logs)- If using Dockerfile builds: verify Dockerfile Ruby/version and Gemfile.lock platforms match your builder OS/arch.
Rails + Docker + native gems (nokogiri, pg, etc.)
Symptoms: Bundler can’t find a platform gem like nokogiri-…-x86_64-linux during build.
Fix pattern:
- Ensure
Gemfile.lockincludes the Linux platform used by Fly’s builder (usuallyx86_64-linux).- Example:
bundle lock --add-platform x86_64-linux
- Example:
- Ensure Dockerfile’s Ruby version matches
.ruby-version.
(See references/rails-docker-builds.md.)
Logs & config (read-only)
- Stream logs:
fly logs -a \x3Capp>
- Show config:
fly config show -a \x3Capp>
- List secrets (names only):
fly secrets list -a \x3Capp>
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.
- Deploy:
fly deploy/fly deploy --remote-only
- SSH exec / console:
fly ssh console -a \x3Capp> -C "\x3Ccommand>"
- Secrets changes:
fly secrets set -a \x3Capp> KEY=value
See references/safety.md.
Fly Postgres basics
Identify the Postgres app
fly postgres list
Attach Postgres to an app
fly postgres attach \x3Cpg-app> -a \x3Capp>
Create a database inside the cluster
fly postgres db create \x3Cdb_name> -a \x3Cpg-app>fly postgres db list -a \x3Cpg-app>
Connect (psql)
fly postgres connect -a \x3Cpg-app>
GitHub Actions deploys / previews
- For production CD: use Fly’s GitHub Action (
superfly/flyctl-actions/setup-flyctl) and runflyctl deploy. - For PR previews:
- Prefer one preview app per PR and one database per PR inside a shared Fly Postgres cluster.
- Automate create/deploy/comment on PR; destroy on close.
(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).
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install flyio-cli - After installation, invoke the skill by name or use
/flyio-cli - Provide required inputs per the skill's parameter spec and get structured output
What is Fly.io CLI?
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. It is an AI Agent Skill for Claude Code / OpenClaw, with 2589 downloads so far.
How do I install Fly.io CLI?
Run "/install flyio-cli" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Fly.io CLI free?
Yes, Fly.io CLI is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Fly.io CLI support?
Fly.io CLI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Fly.io CLI?
It is built and maintained by justinburdett (@justinburdett); the current version is v1.0.3.