The AI Loadout

How to deploy a Website to Cloudflare with an AI agent

Create the project with npm create cloudflare@latest, have your agent build the site, then deploy with npx wrangler deploy. Claude Code, Codex and Cursor can all run those commands. Log in to Wrangler yourself first, so the agent uses your session and never sees a raw API token.

Tested Oct 26, 2026: this site is built with Astro and deployed to Cloudflare Workers with wrangler deploy. Claude Code, Codex and Cursor steps checked against official docs on Oct 26, 2026.

Get the free starter kit. One short email a day when our setups change.

Free starter kit on signup: 2 Claude Code skills and 1 agent persona from our paid packs. By subscribing you agree to get The AI Loadout Daily, one email each morning. No spam, we never sell your email, and every email has a one-click unsubscribe link.

Claude Code

  1. npm create cloudflare@latest -- my-site
  2. npx wrangler login (you do this, in your own terminal)
  3. Ask Claude Code to build the pages and run the local dev server
  4. npx wrangler deploy

Codex

  1. Same commands. Codex may ask approval for network access when it deploys
  2. Ask it to run the build first and fix errors before wrangler deploy

Cursor

  1. Same commands from Cursor's terminal or agent
  2. Approve the deploy command when the agent asks

Grok Bot

  1. Connect Cloudflare and GitHub to Grok Bot
  2. Ask it to build, commit and deploy, and check every page returns 200

Gotchas

  • Check which account and environment wrangler is using before deploying.
  • Put secrets in wrangler secrets, not in the repo.
  • Run the build locally first. A failed deploy wastes a round trip.

The loadout for this job

FAQ

How do I deploy to Cloudflare Workers?

Run npx wrangler deploy from the project after logging in with wrangler login.

Can an AI agent deploy my site?

Yes. It can run the build and deploy commands. Keep the login with you.

Related how-tos

Sources

Commands change. Check the linked docs before you run anything. All how-to guides

Want tested skills and personas installed in one command? See the AI Loadout packs, from $9.