Pages (2)

Last updated Apr 23, 2026 Configure Cloudflare Pages using Wrangler.

pages dev

Develop your full-stack Pages application locally

npmyarnpnpm

npx wrangler pages dev [DIRECTORY] [COMMAND]
yarn wrangler pages dev [DIRECTORY] [COMMAND]
pnpm wrangler pages dev [DIRECTORY] [COMMAND]
  • [DIRECTORY] string The directory of static assets to serve
  • [COMMAND] string The proxy command to run [deprecated]
  • --compatibility-date string Date to use for compatibility checks
  • --compatibility-flags string alias: --compatibility-flag

Flags to use for compatibility checks - --ip string The IP address to listen on - --port number The port to listen on (serve from) - --inspector-port number Port for devtools to connect to - --proxy number The port to proxy (where the static assets are served) - --script-path string The location of the single Worker script if not using functions [default: _worker.js] - --no-bundle boolean Whether to run bundling on _worker.js - --binding array alias: --b

Bind variable/secret (KEY=VALUE) - --kv array alias: --k

KV namespace to bind (--kv KV_BINDING) - --d1 array D1 database to bind (--d1 D1_BINDING) - --do array alias: --o

Durable Object to bind (--do DO_BINDING=CLASS_NAME@SCRIPT_NAME) - --r2 array R2 bucket to bind (--r2 R2_BINDING) - --ai string AI to bind (--ai AI_BINDING) - --version-metadata string Worker Version metadata (--version-metadata VERSION_METADATA_BINDING) - --service array Service to bind (--service SERVICE=SCRIPT_NAME) - --live-reload boolean default: false

Auto reload HTML pages when change is detected - --local-protocol "http" | "https" Protocol to listen to requests on, defaults to http. - --https-key-path string Path to a custom certificate key - --https-cert-path string Path to a custom certificate - --persist-to string Specify directory to use for local persistence (defaults to .wrangler/state) - --log-level "debug" | "info" | "log" | "warn" | "error" | "none" Specify logging level - --show-interactive-dev-session boolean Show interactive dev session (defaults to true if the terminal supports interactivity)

<details>

<summary>

Global flags

</summary>

  • <code>--v</code><code>boolean</code> alias: --version

Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c

Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e

Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false

Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile

</details>

pages functions build

Compile a folder of Pages Functions into a single Worker

npmyarnpnpm

npx wrangler pages functions build [DIRECTORY]
yarn wrangler pages functions build [DIRECTORY]
pnpm wrangler pages functions build [DIRECTORY]
  • [DIRECTORY] string default: functions

The directory of Pages Functions - --outfile string The location of the output Worker script - --outdir string Output directory for the bundled Worker - --output-config-path string The location for the output config file - --build-metadata-path string The location for the build metadata file - --project-directory string The location of the Pages project - --output-routes-path string The location for the output _routes.json file - --minify boolean default: false

Minify the output Worker script - --sourcemap boolean default: false

Generate a sourcemap for the output Worker script - --fallback-service string default: ASSETS

The service to fallback to at the end of the next chain. Setting to '' will fallback to the global fetch. - --watch boolean default: false

Watch for changes to the functions and automatically rebuild the Worker script - --plugin boolean default: false

Build a plugin rather than a Worker script - --build-output-directory string The directory to output static assets to - --compatibility-date string Date to use for compatibility checks - --compatibility-flags string alias: --compatibility-flag

Flags to use for compatibility checks - --external string A list of module imports to exclude from bundling - --metafile string Path to output build metadata from esbuild. If flag is used without a path, defaults to 'bundle-meta.json' inside the directory specified by --outdir.

<details>

<summary>

Global flags

</summary>

  • <code>--v</code><code>boolean</code> alias: --version

Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c

Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e

Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false

Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile

</details>

pages project list

List your Cloudflare Pages projects

npmyarnpnpm

npx wrangler pages project list
yarn wrangler pages project list
pnpm wrangler pages project list
  • --json boolean default: false

Return output as JSON

<details>

<summary>

Global flags

</summary>

  • <code>--v</code><code>boolean</code> alias: --version

Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c

Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e

Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false

Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile

</details>

pages project create

Create a new Cloudflare Pages project

npmyarnpnpm

npx wrangler pages project create <PROJECT-NAME>
yarn wrangler pages project create <PROJECT-NAME>
pnpm wrangler pages project create <PROJECT-NAME>
  • <PROJECT-NAME> string required

The name of your Pages project - --production-branch string The name of the production branch of your project - --compatibility-flags string alias: --compatibility-flag

Flags to use for compatibility checks - --compatibility-date string Date to use for compatibility checks

<details>

<summary>

Global flags

</summary>

  • <code>--v</code><code>boolean</code> alias: --version

Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c

Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e

Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false

Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile

</details>

pages project delete

Delete a Cloudflare Pages project

npmyarnpnpm

npx wrangler pages project delete <PROJECT-NAME>
yarn wrangler pages project delete <PROJECT-NAME>
pnpm wrangler pages project delete <PROJECT-NAME>
  • <PROJECT-NAME> string required

The name of your Pages project - --yes boolean alias: --y

Answer "yes" to confirm project deletion

<details>

<summary>

Global flags

</summary>

  • <code>--v</code><code>boolean</code> alias: --version

Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c

Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e

Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false

Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile

</details>

pages deployment list

List deployments in your Cloudflare Pages project

npmyarnpnpm

npx wrangler pages deployment list
yarn wrangler pages deployment list
pnpm wrangler pages deployment list
  • --project-name string The name of the project you would like to list deployments for
  • --environment string Environment type to list deployments for
  • --json boolean default: false

Return output as JSON

<details>

<summary>

Global flags

</summary>

  • <code>--v</code><code>boolean</code> alias: --version

Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c

Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e

Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false

Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile

</details>

pages deployment tail

Start a tailing session for a project's deployment and livestream logs from your Functions

npmyarnpnpm

npx wrangler pages deployment tail [DEPLOYMENT]
yarn wrangler pages deployment tail [DEPLOYMENT]
pnpm wrangler pages deployment tail [DEPLOYMENT]
  • [DEPLOYMENT] string (Optional) ID or URL of the deployment to tail. Specify by environment if deployment ID is unknown.
  • --project-name string The name of the project you would like to tail
  • --environment string default: production

When not providing a specific deployment ID, specifying environment will grab the latest production or preview deployment - --format string The format of log entries - --status "ok" | "error" | "canceled" Filter by invocation status - --header string Filter by HTTP header - --method string Filter by HTTP method - --search string Filter by a text match in console.log messages - --sampling-rate number Adds a percentage of requests to log sampling rate - --ip string Filter by the IP address the request originates from. Use "self" to filter for your own IP

<details>

<summary>

Global flags

</summary>

  • <code>--v</code><code>boolean</code> alias: --version

Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c