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
npm create cloudflare@latest -- my-sitenpx wrangler login (you do this, in your own terminal)Ask Claude Code to build the pages and run the local dev servernpx wrangler deploy
Codex
Same commands. Codex may ask approval for network access when it deploysAsk it to run the build first and fix errors before wrangler deploy
Cursor
Same commands from Cursor's terminal or agentApprove the deploy command when the agent asks
Grok Bot
Connect Cloudflare and GitHub to Grok BotAsk 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
- Tools: Cursor, Claude
- Repo: OpenAI Codex CLI
- Model: Claude Sonnet 5.5
- Bot: Grok Bot
- Full setup: Best AI for building an app without coding
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