cloudflare-pages-ops

Create, deploy, and manage Cloudflare Pages projects via Wrangler CLI and REST API.

1|1|Updated May 24, 2026
One-click install
npx skills add https://github.com/bm629/agent-skills --skill cloudflare-pages-ops-bm629
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-pages-ops
Source: https://github.com/bm629/agent-skills/tree/main/skills/cloudflare-pages-ops
Command: npx skills add https://github.com/bm629/agent-skills --skill cloudflare-pages-ops-bm629

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Operating Cloudflare Pages from an agent requires juggling two interfaces — the Wrangler CLI for common tasks and the REST API for everything else — plus strict credential handling rules. This Skill encodes that entire workflow so an agent can create projects, deploy builds, manage custom domains, and poll deployment status without guessing commands, hand-rolling multipart uploads, or leaking tokens. ## Core Features & Use Cases - CLI-first operations: Create projects and deploy build directories with validated Wrangler commands (pages project create, pages deploy), running headlessly via CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID — never wrangler login. - REST long tail: Resolve any of 20 Pages operations (domains, deployments, rollback, retry, build-cache purge) from a bundled OpenAPI slice using an endpoint index and a $ref-resolver script, so the full spec never enters context. - Deployment status tracking: Poll the deploy stage machine (queued → initialize → clone_repo → build → deploy) until success or failure, checking the {success, errors, messages, result} envelope rather than HTTP status alone. - Use Case: Ask the agent to deploy ./dist to a Pages project and add a custom domain — it runs the deploy script, captures the deployment id via deployment list --json, polls status, and registers the domain over REST. ## Quick Start Deploy my built ./dist directory to my Cloudflare Pages project and tell me when the deployment reaches success.

Frequently Asked Questions about cloudflare-pages-ops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a site to Cloudflare Pages from the command line?

Run `wrangler pages deploy <dir> --project-name <name>` with CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID exported. Pass the already-built output directory (dist, build) — Wrangler uploads it but does not run your framework build.

How do I add a custom domain to a Cloudflare Pages project?

Use the REST API: POST to /accounts/{account_id}/pages/projects/{project}/domains with a JSON body containing the domain name. Wrangler has no domain command. Note the API only registers the domain — you must create the CNAME record to <project>.pages.dev separately.

Can I use wrangler pages deploy with a Git-connected project?

No. `wrangler pages deploy` works only on Direct-Upload projects. A Git-connected project deploys automatically on git push, and a Direct-Upload project cannot later switch to Git integration.

Why does my Cloudflare API call return 200 but the operation failed?

Every Cloudflare response uses the envelope {success, errors, messages, result}, and a 200 can carry success:false. Always check the success field and read errors[].code and errors[].message instead of trusting the HTTP status.

How do I check Cloudflare Pages deployment status?

Poll the REST get-deployment-info endpoint and inspect latest_stage. The deploy is done when the deploy stage reaches status success, or failed when any stage hits failure. Get the deployment id via `wrangler pages deployment list --json` using the capitalized .Id key.

When should I not use Cloudflare Pages for hosting?

Cloudflare Pages covers static/JAMstack sites plus serverless functions, not full-stack container applications. For container or SSR-as-PaaS workloads, use platforms like Render, Fly.io, or Railway instead.