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).
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install flyio-cli - 安装完成后,直接呼叫该 Skill 的名称或使用
/flyio-cli触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2589 次。
如何安装 Fly.io CLI?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install flyio-cli」即可一键安装,无需额外配置。
Fly.io CLI 是免费的吗?
是的,Fly.io CLI 完全免费(开源免费),可自由下载、安装和使用。
Fly.io CLI 支持哪些平台?
Fly.io CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Fly.io CLI?
由 justinburdett(@justinburdett)开发并维护,当前版本 v1.0.3。