Skip to content
Early bird + Black Friday · 73% off

Get ZeroDirs for $179 $49

Claim $49 deal

The CLI

Every Cloudflare step is a command in this repository. No dashboard, and no command leaves a secret in a file.

Command What it does
pnpm cf:setup Names the Worker, binds your domain, creates the D1 database and R2 bucket, migrates, builds, deploys, sets TOKEN_SECRET
pnpm cf:media Makes the R2 bucket web-readable and writes media.baseUrl
pnpm cf:secrets Sends every runtime secret in .env.prod to the Worker in one request; --dry-run shows the plan, --list the names and what is set
pnpm cf:ci Pushes the build-time half of .env.prod to GitHub Actions and updates the workflow
pnpm cf:doctor Reads it all back and says what is missing. Changes nothing
You need Command You should see
A Cloudflare login pnpm exec wrangler whoami your account name and id
Your domain on that account pnpm exec wrangler zones list the domain in the list. Without one, pnpm cf:setup --workers-dev deploys to *.workers.dev; move later
site.url set to that domain pnpm check:config site.config.ts OK — Your Directory (https://your-domain.com)
  1. See the plan.

    Terminal
    pnpm cf:setup --dry-run

    It prints the Worker name, route, database and bucket it would create, then Nothing changed.

  2. Run it.

    Terminal
    pnpm cf:setup

    Every step prints a ✔, and steps already done say so; a rerun after a failure is safe. It ends with your /admin/ password, shown once — store it now.

  3. Make uploaded images public.

    Terminal
    pnpm cf:media

    With the zone id it points media.<your domain> at the bucket, otherwise at the rate-limited r2.dev URL. Either result goes into media.baseUrl in site.config.ts.

  4. Put your secrets on the Worker.

    Terminal
    cp .env .env.prod # then edit .env.prod: live Stripe keys, the real sender, and so on
    pnpm cf:secrets --dry-run
    pnpm cf:secrets

    The dry run lists what would go up, each value’s length, and why anything is left out: empty, a placeholder, or the wrong field. Nothing uploads until you drop --dry-run.

  5. Check the lot.

    Terminal
    pnpm cf:doctor

    Every line is either ✔ or a problem with the command that fixes it.

Terminal
pnpm cf:ci --enable
git push
  • pnpm cf:ci sends the build-time variables to GitHub Actions, as variables or secrets per the # ci: line above each key in .env.example.
  • It rewrites env: in .github/workflows/deploy.yml, so a variable you add cannot go missing in CI.
  • --enable turns the workflow on.
  • Deploy on git push has the alternative, Workers Builds.
Check Command You should see
Everything at once pnpm cf:doctor cf:doctor — … ok, 0 problems
The site curl -s -o /dev/null -w '%{http_code}' https://your-domain.com/ 200
The admin area open /admin/, signed in as an address in admin.emails the review queue
Secrets on the Worker pnpm cf:secrets --list every key your configuration needs