- Home
- Skills
- DevOps & Cloud
- Staging Lifecycle for Fly.io
Staging Lifecycle for Fly.io
Ship a web app in four steps: tests, keyless local run, a throwaway Fly.io staging copy, production. One command builds, deploys, checks or deletes staging, and your agent never sees a secret.
$5
Works with the AI Agents you already use
Staging Lifecycle for Fly.io
Example session with this skill installed
I need a staging copy of recipebox on Fly.io so my teammate can test the new meal-plan feature on a real phone. Set it up the safe way.
- Read your context and instructions
- Compiled the staging lifecycle
Summary
Staging for recipebox is ready to build. Nothing billed has been created yet: that step is yours.
What I set up
| File | What it holds |
|---|---|
tools/staging.sh | up / deploy / status / down, each with --dry-run |
tools/local.sh | keyless local run on throwaway data |
.staging.conf | APP=recipebox-staging, PROD_APP=recipebox, region fra, volume staging_data, keys file ~/.config/recipebox/staging.env |
fly.staging.toml | copy of fly.toml with app = "recipebox-staging", STAGING = "1", FEATURE_MEAL_PLANS = "1", sleeps when idle |
tools/staging.sh status says recipebox-staging does not exist. The dry run:
$ tools/staging.sh up --dry-run
Dry run: nothing below is executed. Host fly, app recipebox-staging, config fly.staging.toml.
Would create ~/.config/recipebox/staging.env with blank lines for: OPENAI_API_KEY MAPS_BROWSER_KEY (chmod 600), then stop.
Creating app recipebox-staging (skipped if it already exists).
[dry-run] flyctl apps create recipebox-staging --org personal
Creating volume staging_data (1 GB, fra).
[dry-run] flyctl volumes create staging_data --app recipebox-staging --region fra --size 1 --yes
Setting random SECRET_KEY ADMIN_PASSWORD (missing ones only).
[dry-run] flyctl secrets import --stage --app recipebox-staging (generated values on stdin)
[dry-run] flyctl secrets import --stage --app recipebox-staging (values on stdin)
Deploying ~/code/recipebox (branch meal-plans) to recipebox-staging.
[dry-run] flyctl deploy --config fly.staging.toml --app recipebox-staging --ha=false
Seeding staging.
[dry-run] flyctl ssh console --app recipebox-staging -C 'python /app/tools/seed_demo.py'
Done: https://recipebox-staging.fly.dev
Your turn
- Approve the build:
tools/staging.sh upcreates a Fly app and a 1 GB volume (bills while awake, a few dollars a month at most). - The first
upwrites~/.config/recipebox/staging.envand stops. Put staging's own keys in it, in your editor. I won't read it. - Run
upagain. I'll thendeployafter each change and send your teammate the URL. - When testing is over, run
tools/staging.sh downand typerecipebox-staging. Your keys file stays, so the nextuprebuilds in minutes.
Connects securely to your tools. The creator never sees your data.
About this skill
What it does
Gives your agent a release path it follows on every project: tests → local → staging → production, with a staging copy that exists only while you are testing.
tools/staging.sh:upcreates whatever is missing (Fly app, volume, random app secrets), pushes staging's own keys, deploys and seeds demo data.deployships code only.statusshows secret names, never values.downdeletes it.--dry-runon every command.tools/local.sh: starts your app with every name in your.envfiles set to empty, on throwaway data, so a local run can never spend money or send mail.SKILL.md: tells the agent which steps it may run alone (tests, local, dry runs,status,deploy) and which need you (creating or deleting billed resources, anything in production).
Why
The classic Fly.io accident: flyctl deploy in a repo with fly.toml goes to production. This script names the staging app and staging config on every call, and refuses to run if:
- the app name lacks
staging, equals your production app, or disagrees with the config file - the keys file sits inside the repo or any git checkout
Secrets stay yours
Keys live in one file outside the repo, chmod 600. Only the names you list are read, and values reach Fly over stdin, never on a command line or in the agent's context. App secrets are generated once and never printed. down asks you to type the app name on a terminal; piped input is refused, so an agent cannot confirm a delete for you.
Adopt it
Ask your agent to "adopt staging-lifecycle in this project". It copies the templates, writes .staging.conf and fly.staging.toml, runs up --dry-run, and leaves the first real up to you. See EXAMPLE.md for a filled-in project.
Fly.io today. The script dispatches through per-host functions, so other hosts can be added.
Fly.io only today; other hosts need their own host functions in staging.sh. Needs a local shell (macOS, Linux or WSL). The first up (creates billed resources) and every down are left to you on purpose. local.sh assumes your dotenv loader does not override variables that are already set.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
Requires
Permissions
Allowed Hosts