← 返回
开发者工具

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.
{"answer":"使用flyctl CLI部署和运维Fly.io应用。默认仅进行只读诊断(状态/日志/配置/版本)。状态更改操作(部署、SSH、密钥、扩缩容、机器、卷、Postgres更改)需用户明确批准。适用于Fly.io部署、构建/运行故障排查、GitHub Actions部署/预览配置及安全管理。"}
justinburdett
开发者工具 clawhub v1.0.3 1 版本 99659.9 Key: 无需
★ 1
Stars
📥 2,910
下载
💾 160
安装
1
版本
#latest

概述

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:

1) Confirm which app you’re targeting

  • fly app list
  • fly status -a
  • Check 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)
  • 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.lock includes the Linux platform used by Fly’s builder (usually x86_64-linux).
  • Example: bundle lock --add-platform x86_64-linux
  • Ensure Dockerfile’s Ruby version matches .ruby-version.

(See references/rails-docker-builds.md.)

Logs & config (read-only)

  • Stream logs:
  • fly logs -a
  • Show config:
  • fly config show -a
  • List secrets (names only):
  • 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.

  • Deploy:
  • fly deploy / fly deploy --remote-only
  • SSH exec / console:
  • fly ssh console -a -C ""
  • Secrets changes:
  • fly secrets set -a KEY=value

See references/safety.md.

Fly Postgres basics

Identify the Postgres app

  • fly postgres list

Attach 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

  • For production CD: use Fly’s GitHub Action (superfly/flyctl-actions/setup-flyctl) and run flyctl 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).

版本历史

共 1 个版本

  • v1.0.3 当前
    2026-03-28 12:13 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

RSSaurus - Agent-Friendly RSS Feed Reader

justinburdett
使用RSSaurus命令行工具(Go二进制`rssaurus`)在终端操作https://rssaurus.com:包括身份验证、列出订阅源/条目、输出URL供管道处理、打开链接,以及执行分类操作(已读/未读、批量已读、保存/取消保存)。适
★ 1 📥 3,840
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,794
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,843