Ship Faster with Cloudflare + OpenAI Codex
Tired of doing boilerplate work when you just want to vibe and ship? Here’s a minimal setup that makes Cloudflare build every branch and PR and lets OpenAI Codex write features and fixes for you straight from the web UI.
This is what I've been using to build Klykd's beta.
Part 1 — Continuous Builds with Cloudflare Pages
We’ll wire up Cloudflare Pages so every branch and PR auto-deploys.
1. Connect your repo
- Go to Cloudflare Dashboard → Pages → Create a project.
- Select Connect to Git and choose your GitHub repo:
username/reponame. - Authorize Cloudflare to read it.
2. Configure builds
- Enter your build command (for example
npm run build,go build, ormake). - Enter the output directory (for example
distorbuild). - Set Production branch to
main.
3. Enable branch and PR previews
- Settings → Build & Deploy → Preview branch control.
- Select All non-Production branches.
- Now every branch gets its own deploy URL.
4. Pull request previews
- Whenever you open a PR, Cloudflare posts a unique preview link.
- Every new commit to the PR updates that preview.
That’s it. Any new branch or PR instantly has a live URL you can share.
Part 2 — AI-Written PRs with OpenAI Codex
Next, offload the boring part. Codex lives at chatgpt.com/codex and speaks GitHub directly.
1. Open Codex
- Visit chatgpt.com/codex.
- Log in with your OpenAI account.
2. Connect your GitHub repo
- In Codex, click Add repository.
- Pick
username/reponame. - Authorize with GitHub so Codex can create branches and PRs.
3. Lock down permissions
- Set Default base branch to
main. - Enable Require PR.
- Disable direct pushes. Codex will only work via branches + PRs.
4. Create a task
- Click New task.
- Write what you want, e.g.:
Add /healthz endpoint returning 200 OK JSON {"status":"ok"} and a unit test.
- Codex loads your repo into its sandbox, proposes a plan, and shows which files it’ll touch.
5. Approve and review
- Approve the plan.
- Codex edits files, runs tests, and shows the diff.
- You get a ready branch like
codex/task-healthz.
6. Open a pull request
- Click Create pull request.
- Codex opens a PR back to
mainwith commits, test results, and the diff.- As we mentioned before, here Cloudflare builds the branch and posts a unique link for you to test it before merging.
7. Iterate
- Inside the PR, you can hit Ask Codex to refine the code.
- Codex updates the branch and reruns tests.
8. Merge and deploy
- Once tests pass and you’re happy, merge the PR.
- Cloudflare instantly builds the branch and updates the preview.
- Merging to
maintriggers a production deploy.
It doesn't get much easier than this, and you can be vibe coding from your phone as you don't even have to type a single command outside Codex chat 😄
Member discussion