> cloudflare pages
Cloudflare Pages hosts static sites and full-stack apps (Pages Functions) on Cloudflare's edge, and wrangler drives the whole lifecycle from the terminal. Create projects, deploy built output, run Functions locally with KV/D1/R2 bindings, manage per-environment secrets, and tail production logs. These are the `wrangler pages ...` commands you actually reach for on a working project.
// cloudflare pages
10 commands$ wrangler pages project create my-app$ wrangler pages deploy ./dist --project-name my-app$ wrangler pages deploy ./dist --project-name my-app --branch feature-login$ wrangler pages deploy ./dist --project-name my-app --branch "$GITHUB_REF_NAME" --commit-hash "$GITHUB_SHA" --commit-message "$(git log -1 --pretty=%s)" --commit-dirty=true$ wrangler pages dev ./dist$ wrangler pages dev ./dist --kv CACHE --d1 DB --r2 UPLOADS$ wrangler pages dev ./dist --compatibility-date 2024-09-23 --compatibility-flag nodejs_compat$ wrangler pages secret put DATABASE_URL --project-name my-app$ wrangler pages secret bulk ./secrets.json --project-name my-app$ wrangler pages deployment tail --project-name my-app// faq
What's the difference between `wrangler pages deploy` and `wrangler deploy`?
`wrangler pages deploy` uploads a directory of built static assets (plus any `functions/` or `_worker.js`) to a Pages project. `wrangler deploy` publishes a standalone Worker script. Use Pages for a site with optional Functions; use the Workers deploy for a pure Worker.
How do I ship a preview instead of production?
Deploy to any branch other than the project's production branch: `--branch <name>`. Non-production branches get a unique `*.pages.dev` preview URL with their own preview-environment secrets; only the production branch updates your live domain. It's the branch name, not a separate flag, that decides prod vs preview.
Why can't I read a secret back after setting it?
Pages secrets are write-only. `secret put` encrypts the value at rest, and `secret list` shows only the names. To change one, put a new value over it — there's no command to reveal the current secret.