flypod
Guides

Use with agents & CI

The canonical playbook for driving flypod from an agent or CI job. Covers non-interactive output, capturing the URL, exit codes, authentication, and idempotent re-deploys.

flypod is built to be driven by machines. Deploys are non-interactive by default whenever stdout isn't a TTY: no prompts, no animation. This page is the reference for running it from an agent or a CI job.

Capture the URL

The live URL is always on stdout; the banner, spinner, and hints go to stderr. So you can capture the URL directly:

URL=$(npx flypod ./dist --quiet)

Or parse structured output:

npx flypod ./dist --json | jq -r .url

flypod auto-detects a non-TTY stdout and strips the animation. You don't need a flag for that, but --quiet (URL only) and --json (structured) make the contract explicit and are recommended in scripts.

The two output modes

Modestdoutstderr
--quietthe live URLmanage_token
--jsona JSON object (see below)nothing

The --json object:

{
  "ok": true,
  "url": "https://ab12cd34.flypod.dev",
  "site_id": "ab12cd34",
  "version_id": "v_...",
  "expires_at": "2026-07-02T00:00:00.000Z",
  "manage_token": "...",
  "claim_token": "...",
  "owner_account_id": null,
  "source": "./dist",
  "files": 12,
  "bytes": 48211,
  "elapsed_ms": 734
}

Exit codes

CodeMeaning
0Success.
non-zeroFailure (deploy error, network, auth).
2Unknown flag.

Check the exit code, not the text:

if URL=$(npx flypod ./dist --quiet); then
  echo "deployed: $URL"
else
  echo "deploy failed" >&2
  exit 1
fi

Authenticate in a job

Agents running on a developer machine use the session saved by the browser device flow:

flypod login
npx flypod ./dist --quiet

For a stateless job, pass an existing account session token through the secret store. No login file is written:

export FLYPOD_TOKEN="$FLYPOD_SESSION"
npx flypod ./dist --quiet

FLYPOD_TOKEN takes precedence over a saved login. The legacy FLYPOD_API_KEY name is still accepted as a fallback for older integrations. With no credential, the deploy is anonymous.

Authenticated deploys are owned and permanent. No 14-day TTL. Anonymous deploys (no login) expire after 14 days. See Accounts & claiming.

Idempotent re-deploys

To ship a new version to the same site instead of creating a new one, use flypod update. flypod links the working directory to its site, so no ID is needed:

npx flypod update --quiet

If the content is unchanged, update is a no-op ("No changes" message), safe to run on every push. If the linked site is gone (404), flypod drops the stale link and tells you to run flypod to deploy fresh. In an ephemeral CI checkout where no folder link exists, pass --site <id> (and --token <manage_token> for anonymous sites).

Server override

Point the CLI at a different backend with DEPLOY_URL:

DEPLOY_URL=https://example.internal npx flypod ./dist --json

Other recognized env vars: FLYPOD_CONFIG_DIR (credential/link location), NO_COLOR, FORCE_COLOR.

Minimal agent recipe

# authenticate (session from your secret store)
export FLYPOD_TOKEN="$FLYPOD_SESSION"

# first deploy → capture site_id for later
SITE=$(npx flypod ./dist --json | jq -r .site_id)

# subsequent runs → idempotent update to the same site
npx flypod update --site "$SITE" --json | jq -r .url

Next steps

On this page