Do not run state-changing Fly.io commands without explicit user approval (deploy/scale, secrets set/unset, volume/db create/drop, app destroy, attach/detach).
scripts/fly_app_from_toml.sh: tiny helper to print the Fly app name from fly.toml.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: demerzels-lab-elsamultiskillagent-flyio-cli3description: Fly.io (flyctl) CLI4---56# Fly.io (flyctl) CLI78Operate Fly.io apps safely and repeatably with `flyctl`.910## Common tasks1112- Deploy: `fly deploy` / `fly deploy --remote-only`13- Logs: `fly logs -a <app>`14- SSH / run commands: `fly ssh console -a <app> -C "…"`15- Secrets: `fly secrets list/set -a <app>`16- Postgres: `fly postgres list/connect/db create/attach`17- GitHub Actions deploys / PR previews1819## Defaults / safety2021- Prefer **read-only** commands first: `fly status`, `fly logs`, `fly config show`, `fly releases`, `fly secrets list`.22- **Do not run state-changing Fly.io commands without explicit user approval** (deploy/scale, secrets set/unset, volume/db create/drop, app destroy, attach/detach).23 - Read-only actions are OK without approval.24 - Destructive actions (destroy/drop) always require explicit approval.25- When debugging, classify the failure as: build/packaging vs runtime vs platform.2627## Quick start (typical deploy)2829From the app repo directory:30311) Confirm which app you’re targeting32- `fly app list`33- `fly status -a <app>`34- Check `fly.toml` for `app = "..."`35362) Deploy37- `fly deploy` (default)38- `fly deploy --remote-only` (common when local docker/build env is inconsistent)39403) Validate41- `fly status -a <app>`42- `fly logs -a <app>`43- `fly open -a <app>`4445## Debugging deploy/build failures4647### Common checks48- `fly deploy --verbose` (more build logs)49- If using Dockerfile builds: verify Dockerfile Ruby/version and Gemfile.lock platforms match your builder OS/arch.5051### Rails + Docker + native gems (nokogiri, pg, etc.)52Symptoms: Bundler can’t find a platform gem like `nokogiri-…-x86_64-linux` during build.5354Fix pattern:55- Ensure `Gemfile.lock` includes the Linux platform used by Fly’s builder (usually `x86_64-linux`).56 - Example: `bundle lock --add-platform x86_64-linux`57- Ensure Dockerfile’s Ruby version matches `.ruby-version`.5859(See `references/rails-docker-builds.md`.)6061## Logs, SSH, console6263- Stream logs:64 - `fly logs -a <app>`65- SSH console:66 - `fly ssh console -a <app>`67- Run a one-off command:68 - `fly ssh console -a <app> -C "bin/rails db:migrate"`6970## Secrets / config7172- List secrets:73 - `fly secrets list -a <app>`74- Set secrets:75 - `fly secrets set -a <app> KEY=value OTHER=value`76- Show config:77 - `fly config show -a <app>`7879## Fly Postgres basics8081### Identify the Postgres app82- `fly postgres list`8384### Attach Postgres to an app85- `fly postgres attach <pg-app> -a <app>`8687### Create a database inside the cluster88- `fly postgres db create <db_name> -a <pg-app>`89- `fly postgres db list -a <pg-app>`9091### Connect (psql)92- `fly postgres connect -a <pg-app>`9394## GitHub Actions deploys / previews9596- For production CD: use Fly’s GitHub Action (`superfly/flyctl-actions/setup-flyctl`) and run `fly deploy` (often with `--remote-only`).97- For PR previews:98 - Prefer one **preview app per PR** and one **database per PR** inside a shared Fly Postgres cluster.99 - Automate create/deploy/comment on PR; destroy on close.100101(See `references/github-actions.md`.)102103## Bundled resources104105- `references/rails-docker-builds.md`: Rails/Docker/Fly build failure patterns + fixes.106- `references/github-actions.md`: Fly deploy + preview workflows.107- `scripts/fly_app_from_toml.sh`: tiny helper to print the Fly app name from fly.toml.108109---110> Converted and distributed by [TomeVault](https://tomevault.io/claim/demerzels-lab) — claim your Tome and manage your conversions.111<!-- tomevault:4.0:skill_md:2026-04-13 -->
Run npx skillmds@latest add tomevault-io/demerzels-lab-elsamultiskillagent-flyio-cli in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Fly.io (flyctl) CLI It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.