Skip to content
Cloudflare Docs

Commands

Wrangler offers a number of commands to manage your Cloudflare Workers.

  • docs - Open this page in your default browser.
  • init - Create a new project from a variety of web frameworks and templates.
  • containers - Interact with Containers.
  • d1 - Interact with D1.
  • vectorize - Interact with Vectorize indexes.
  • hyperdrive - Manage your Hyperdrives.
  • deploy - Deploy your Worker to Cloudflare.
  • dev - Start a local server for developing your Worker.
  • delete - Delete your Worker from Cloudflare.
  • kv namespace - Manage Workers KV namespaces.
  • kv key - Manage key-value pairs within a Workers KV namespace.
  • kv bulk - Manage multiple key-value pairs within a Workers KV namespace in batches.
  • r2 bucket - Manage Workers R2 buckets.
  • r2 object - Manage Workers R2 objects.
  • secret - Manage the secret variables for a Worker.
  • secret bulk - Manage multiple secret variables for a Worker.
  • secrets-store secret - Manage account secrets within a secrets store.
  • secrets-store store - Manage your store within secrets store.
  • workflows - Manage and configure Workflows.
  • tail - Start a session to livestream logs from a deployed Worker.
  • pages - Configure Cloudflare Pages.
  • pipelines - Configure Cloudflare Pipelines.
  • queues - Configure Workers Queues.
  • login - Authorize Wrangler with your Cloudflare account using OAuth.
  • logout - Remove Wrangler’s authorization for accessing your account.
  • whoami - Retrieve your user information and test your authentication configuration.
  • versions - Retrieve details for recent versions.
  • deployments - Retrieve details for recent deployments.
  • rollback - Rollback to a recent deployment.
  • dispatch-namespace - Interact with a dispatch namespace.
  • mtls-certificate - Manage certificates used for mTLS connections.
  • cert - Manage certificates used for mTLS and Certificate Authority (CA) chain connections.
  • types - Generate types from bindings and module rules in configuration.
  • telemetry - Configure whether Wrangler can collect anonymous usage data.
  • check - Validate your Worker.

How to run Wrangler commands

This page provides a reference for Wrangler commands.

wrangler <COMMAND> <SUBCOMMAND> [PARAMETERS] [OPTIONS]

Since Cloudflare recommends installing Wrangler locally in your project(rather than globally), the way to run Wrangler will depend on your specific setup and package manager.

Terminal window
npx wrangler <COMMAND> <SUBCOMMAND> [PARAMETERS] [OPTIONS]

You can add Wrangler commands that you use often as scripts in your project's package.json file:

{
...
"scripts": {
"deploy": "wrangler deploy",
"dev": "wrangler dev"
}
...
}

You can then run them using your package manager of choice:

Terminal window
npm run deploy

docs

Open the Cloudflare developer documentation in your default browser.

Terminal window
npx wrangler docs [SEARCH]
  • --search string

    Enter search terms (e.g. the wrangler command) you want to know more about

  • --yes boolean alias: --y

    Takes you to the docs, even if search fails

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning


init

Create a new project via the create-cloudflare-cli (C3) tool. A variety of web frameworks are available to choose from as well as templates. Dependencies are installed by default, with the option to deploy your project immediately.

wrangler init [<NAME>] [OPTIONS]
  • NAME string optional (default: name of working directory)
    • The name of the Workers project. This is both the directory name and name property in the generated Wrangler configuration.
  • --yes boolean optional
    • Answer yes to any prompts for new projects.
  • --from-dash string optional
    • Fetch a Worker initialized from the dashboard. This is done by passing the flag and the Worker name. wrangler init --from-dash <WORKER_NAME>.
    • The --from-dash command will not automatically sync changes made to the dashboard after the command is used. Therefore, it is recommended that you continue using the CLI.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

containers

Interact with Cloudflare's Container Platform.

build

Build a Container image from a Dockerfile.

wrangler containers build [PATH] [OPTIONS]
  • PATH string optional
    • Path for the directory containing the Dockerfile to build.
  • -t, --tag string required
    • Name and optionally a tag (format: "name:tag").
  • --path-to-docker string optional
    • Path to your docker binary if it's not on $PATH.
    • Default: "docker"
  • -p, --push boolean optional
    • Push the built image to Cloudflare's managed registry.
    • Default: false

delete

Delete a Container (application).

wrangler containers delete <CONTAINER_ID> [OPTIONS]
  • CONTAINER_ID string required
    • The ID of the Container to delete.

images

Perform operations on images in your containers registry.

images list

List images in your containers registry.

wrangler containers images list [OPTIONS]
  • --filter string optional
    • Regex to filter results.
  • --json boolean optional
    • Return output as clean JSON.
    • Default: false

images delete

Remove an image from your containers registry.

wrangler containers images delete [IMAGE] [OPTIONS]
  • IMAGE string required
    • Image to delete of the form IMAGE:TAG

info

Get information about a specific Container, including top-level details and a list of instances.

wrangler containers info <CONTAINER_ID> [OPTIONS]
  • CONTAINER_ID string required
    • The ID of the Container to get information about.

list

List the Containers in your account.

wrangler containers list [OPTIONS]

push

Push a tagged image to a Cloudflare managed registry, which is automatically integrated with your account.

wrangler containers push [TAG] [OPTIONS]
  • TAG string required
    • The name and tag of the container image to push.
  • --path-to-docker string optional
    • Path to your docker binary if it's not on $PATH.
    • Default: "docker"

d1

Interact with Cloudflare's D1 service.

create

Creates a new D1 database, and provides the binding and UUID that you will put in your Wrangler file.

wrangler d1 create <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the new D1 database.
  • --location string optional
    • Provide an optional location hint for your database leader.
    • Available options include weur (Western Europe), eeur (Eastern Europe), apac (Asia Pacific), oc (Oceania), wnam (Western North America), and enam (Eastern North America).

info

Get information about a D1 database, including the current database size and state.

wrangler d1 info <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database to get information about.
  • --json boolean optional
    • Return output as JSON rather than a table.

list

List all D1 databases in your account.

wrangler d1 list [OPTIONS]
  • --json boolean optional
    • Return output as JSON rather than a table.

delete

Delete a D1 database.

wrangler d1 delete <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database to delete.
  • -y, --skip-confirmation boolean optional
    • Skip deletion confirmation prompt.

execute

Execute a query on a D1 database.

wrangler d1 execute <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database to execute a query on.
  • --command string optional
    • The SQL query you wish to execute.
  • --file string optional
    • Path to the SQL file you wish to execute.
  • -y, --yes boolean optional
    • Answer yes to any prompts.
  • --local boolean (default: true) optional
    • Execute commands/files against a local database for use with wrangler dev.
  • --remote boolean (default: false) optional
  • --persist-to string optional
    • Specify directory to use for local persistence (for use in combination with --local).
  • --json boolean optional
    • Return output as JSON rather than a table.
  • --preview boolean optional

export

Export a D1 database or table's schema and/or content to a .sql file.

wrangler d1 export <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database to export.
  • --local boolean (default: true) optional
  • --remote boolean (default: false) optional
  • --output string required
    • Path to the SQL file for your export.
  • --table string optional
    • The name of the table within a D1 database to export.
  • --no-data boolean (default: false) optional
    • Controls whether export SQL file contains database data. Note that --no-data=true is not recommended due to a known wrangler limitation that intreprets the value as false.
  • --no-schema boolean (default: false) optional
    • Controls whether export SQL file contains database schema. Note that --no-schema=true is not recommended due to a known wrangler limitation that intreprets the value as false.

time-travel restore

Restore a database to a specific point-in-time using Time Travel.

wrangler d1 time-travel restore <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database to execute a query on.
  • --bookmark string optional
    • A D1 bookmark representing the state of a database at a specific point in time.
  • --timestamp string optional
    • A UNIX timestamp or JavaScript date-time string within the last 30 days.
  • --json boolean optional
    • Return output as JSON rather than a table.

time-travel info

Inspect the current state of a database for a specific point-in-time using Time Travel.

wrangler d1 time-travel info <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database to execute a query on.
  • --timestamp string optional
    • A UNIX timestamp or JavaScript date-time string within the last 30 days.
  • --json bboolean optional
    • Return output as JSON rather than a table.

migrations create

Create a new migration.

This will generate a new versioned file inside the migrations folder. Name your migration file as a description of your change. This will make it easier for you to find your migration in the migrations folder. An example filename looks like:

0000_create_user_table.sql

The filename will include a version number and the migration name you specify below.

wrangler d1 migrations create <DATABASE_NAME> <MIGRATION_NAME>
  • DATABASE_NAME string required
    • The name of the D1 database you wish to create a migration for.
  • MIGRATION_NAME string required
    • A descriptive name for the migration you wish to create.

migrations list

View a list of unapplied migration files.

wrangler d1 migrations list <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database you wish to list unapplied migrations for.
  • --local boolean optional
    • Show the list of unapplied migration files on your locally persisted D1 database.
  • --remote boolean (default: false) optional
    • Show the list of unapplied migration files on your remote D1 database.
  • --persist-to string optional
    • Specify directory to use for local persistence (for use in combination with --local).
  • --preview boolean optional
    • Show the list of unapplied migration files on your preview D1 database (as defined by preview_database_id in the Wrangler configuration file).

migrations apply

Apply any unapplied migrations.

This command will prompt you to confirm the migrations you are about to apply. Confirm that you would like to proceed. After, a backup will be captured.

The progress of each migration will be printed in the console.

When running the apply command in a CI/CD environment or another non-interactive command line, the confirmation step will be skipped, but the backup will still be captured.

If applying a migration results in an error, this migration will be rolled back, and the previous successful migration will remain applied.

wrangler d1 migrations apply <DATABASE_NAME> [OPTIONS]
  • DATABASE_NAME string required
    • The name of the D1 database you wish to apply your migrations on.
  • --env string optional
    • Specify which environment configuration to use for D1 binding
  • --local boolean (default: true) optional
    • Execute any unapplied migrations on your locally persisted D1 database.
  • --remote boolean (default: false) optional
    • Execute any unapplied migrations on your remote D1 database.
  • --persist-to string optional
    • Specify directory to use for local persistence (for use in combination with --local).
  • --preview boolean optional

hyperdrive

Manage Hyperdrive database configurations.

hyperdrive create

Create a Hyperdrive config

Terminal window
npx wrangler hyperdrive create [NAME]
  • --name string required

    The name of the Hyperdrive config

  • --connection-string string

    The connection string for the database you want Hyperdrive to connect to - ex: protocol://user:password@host:port/database

  • --origin-host string alias: --host

    The host of the origin database

  • --origin-port number alias: --port

    The port number of the origin database

  • --origin-scheme string alias: --scheme default: postgresql

    The scheme used to connect to the origin database

  • --database string

    The name of the database within the origin database

  • --origin-user string alias: --user

    The username used to connect to the origin database

  • --origin-password string alias: --password

    The password used to connect to the origin database

  • --access-client-id string

    The Client ID of the Access token to use when connecting to the origin database

  • --access-client-secret string

    The Client Secret of the Access token to use when connecting to the origin database

  • --caching-disabled boolean

    Disables the caching of SQL responses

  • --max-age number

    Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled

  • --swr number

    Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled

  • --ca-certificate-id string alias: --ca-certificate-uuid

    Sets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate.

  • --mtls-certificate-id string alias: --mtls-certificate-uuid

    Sets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates.

  • --sslmode string

    Sets CA sslmode for connecting to database.

  • --origin-connection-limit number

    The (soft) maximum number of connections that Hyperdrive may establish to the origin database

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

hyperdrive delete

Delete a Hyperdrive config

Terminal window
npx wrangler hyperdrive delete [ID]
  • --id string required

    The ID of the Hyperdrive config

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

hyperdrive get

Get a Hyperdrive config

Terminal window
npx wrangler hyperdrive get [ID]
  • --id string required

    The ID of the Hyperdrive config

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

hyperdrive list

List Hyperdrive configs

Terminal window
npx wrangler hyperdrive list

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

hyperdrive update

Update a Hyperdrive config

Terminal window
npx wrangler hyperdrive update [ID]
  • --id string required

    The ID of the Hyperdrive config

  • --name string

    Give your config a new name

  • --connection-string string

    The connection string for the database you want Hyperdrive to connect to - ex: protocol://user:password@host:port/database

  • --origin-host string alias: --host

    The host of the origin database

  • --origin-port number alias: --port

    The port number of the origin database

  • --origin-scheme string alias: --scheme

    The scheme used to connect to the origin database

  • --database string

    The name of the database within the origin database

  • --origin-user string alias: --user

    The username used to connect to the origin database

  • --origin-password string alias: --password

    The password used to connect to the origin database

  • --access-client-id string

    The Client ID of the Access token to use when connecting to the origin database

  • --access-client-secret string

    The Client Secret of the Access token to use when connecting to the origin database

  • --caching-disabled boolean

    Disables the caching of SQL responses

  • --max-age number

    Specifies max duration for which items should persist in the cache, cannot be set when caching is disabled

  • --swr number

    Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled

  • --ca-certificate-id string alias: --ca-certificate-uuid

    Sets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate.

  • --mtls-certificate-id string alias: --mtls-certificate-uuid

    Sets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates.

  • --sslmode string

    Sets CA sslmode for connecting to database.

  • --origin-connection-limit number

    The (soft) maximum number of connections that Hyperdrive may establish to the origin database

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning


vectorize

Interact with a Vectorize vector database.

create

Creates a new vector index, and provides the binding and name that you will put in your Wrangler file.

Terminal window
npx wrangler vectorize create <INDEX_NAME> [--dimensions=<NUM_DIMENSIONS>] [--metric=<DISTANCE_METRIC>] [--description=<DESCRIPTION>]
  • INDEX_NAME string required
    • The name of the new index to create. Must be unique for an account and cannot be changed after creation.
  • --dimensions number required
    • The vector dimension width to configure the index for. Cannot be changed after creation.
  • --metric string required
    • The distance metric to use for calculating vector distance. Must be one of cosine, euclidean, or dot-product.
  • --description string optional
    • A description for your index.
  • --deprecated-v1 boolean optional
    • Create a legacy Vectorize index. Please note that legacy Vectorize indexes are on a deprecation path.

list

List all Vectorize indexes in your account, including the configured dimensions and distance metric.

Terminal window
npx wrangler vectorize list
  • --deprecated-v1 boolean optional
    • List legacy Vectorize indexes. Please note that legacy Vectorize indexes are on a deprecation path.

get

Get details about an individual index, including its configuration.

Terminal window
npx wrangler vectorize get <INDEX_NAME>
  • INDEX_NAME string required
    • The name of the index to fetch details for.
  • --deprecated-v1 boolean optional
    • Get a legacy Vectorize index. Please note that legacy Vectorize indexes are on a deprecation path.

info

Get some additional information about an individual index, including the vector count and details about the last processed mutation.

Terminal window
npx wrangler vectorize info <INDEX_NAME>
  • INDEX_NAME string required
    • The name of the index to fetch details for.

delete

Delete a Vectorize index.

Terminal window
npx wrangler vectorize delete <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index to delete.
  • --force boolean optional
    • Skip confirmation when deleting the index (Note: This is not a recoverable operation).
  • --deprecated-v1 boolean optional
    • Delete a legacy Vectorize index. Please note that legacy Vectorize indexes are on a deprecation path.

insert

Insert vectors into an index.

Terminal window
npx wrangler vectorize insert <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index to upsert vectors in.
  • --file string required
    • A file containing the vectors to insert in newline-delimited JSON (JSON) format.
  • --batch-size number optional
    • The number of vectors to insert at a time (default: 1000).
  • --deprecated-v1 boolean optional
    • Insert into a legacy Vectorize index. Please note that legacy Vectorize indexes are on a deprecation path.

upsert

Upsert vectors into an index. Existing vectors in the index would be overwritten.

Terminal window
npx wrangler vectorize upsert <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index to upsert vectors in.
  • --file string required
    • A file containing the vectors to insert in newline-delimited JSON (JSON) format.
  • --batch-size number optional
    • The number of vectors to insert at a time (default: 5000).

query

Query a Vectorize index for similar vectors.

Terminal window
npx wrangler vectorize query <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index to query.
  • --vector array optional
    • Vector against which the Vectorize index is queried. Either this or the vector-id param must be provided.
  • --vector-id string optional
    • Identifier for a vector that is already present in the index against which the index is queried. Either this or the vector param must be provided.
  • --top-k number optional
    • The number of vectors to query (default: 5).
  • --return-values boolean optional
    • Enable to return vector values in the response (default: false).
  • --return-metadata string optional
    • Enable to return vector metadata in the response. Must be one of none, indexed, or all (default: none).
  • --namespace string optional
    • Query response to only include vectors from this namespace.
  • --filter string optional
    • Filter vectors based on this metadata filter. Example: '{ 'p1': 'abc', 'p2': { '$ne': true }, 'p3': 10, 'p4': false, 'nested.p5': 'abcd' }'

list-vectors

List vector identifiers in a Vectorize index in a paginated manner.

Terminal window
npx wrangler vectorize list-vectors <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index from which vector identifiers need to be listed.
  • --count number optional
    • Number of vector IDs to return per page. Must be between 1 and 1000 (default: 100).
  • --cursor string optional
    • Pagination cursor from the previous response to continue listing from that position.

get-vectors

Fetch vectors from a Vectorize index using the provided ids.

Terminal window
npx wrangler vectorize get-vectors <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index from which vectors need to be fetched.
  • --ids array required
    • List of ids for which vectors must be fetched.

delete-vectors

Delete vectors in a Vectorize index using the provided ids.

Terminal window
npx wrangler vectorize delete-vectors <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index from which vectors need to be deleted.
  • --ids array required
    • List of ids corresponding to the vectors that must be deleted.

create-metadata-index

Enable metadata filtering on the specified property.

Terminal window
npx wrangler vectorize create-metadata-index <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index for which metadata index needs to be created.
  • --property-name string required
    • Metadata property for which metadata filtering should be enabled.
  • --type string required
    • Data type of the property. Must be one of string, number, or boolean.

list-metadata-index

List metadata properties on which metadata filtering is enabled.

Terminal window
npx wrangler vectorize list-metadata-index <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index for which metadata indexes needs to be fetched.

delete-metadata-index

Disable metadata filtering on the specified property.

Terminal window
npx wrangler vectorize delete-metadata-index <INDEX_NAME> [OPTIONS]
  • INDEX_NAME string required
    • The name of the Vectorize index for which metadata index needs to be disabled.
  • --property-name string required
    • Metadata property for which metadata filtering should be disabled.

dev

Start a local server for developing your Worker.

wrangler dev [<SCRIPT>] [OPTIONS]
  • SCRIPT string
    • The path to an entry point for your Worker. Only required if your Wrangler configuration file does not include a main key (for example, main = "index.js").
  • --name string optional
    • Name of the Worker.
  • --config, -c string[] optional
    • Path(s) to Wrangler configuration file. If not provided, Wrangler will use the nearest config file based on your current working directory.
    • You can provide multiple configuration files to run multiple Workers in one dev session like this: wrangler dev -c ./wrangler.toml -c ../other-worker/wrangler.toml. The first config will be treated as the primary Worker, which will be exposed over HTTP. The remaining config files will only be accessible via a service binding from the primary Worker.
  • --no-bundle boolean (default: false) optional
    • Skip Wrangler's build steps. Particularly useful when using custom builds. Refer to Bundling for more information.
  • --env string optional
    • Perform on a specific environment.
  • --compatibility-date string optional
    • A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used.
  • --compatibility-flags, --compatibility-flag string[] optional
    • Flags to use for compatibility checks.
  • --latest boolean (default: true) optional
    • Use the latest version of the Workers runtime.
  • --ip string optional
    • IP address to listen on, defaults to localhost.
  • --port number optional
    • Port to listen on.
  • --inspector-port number optional
    • Port for devtools to connect to.
  • --routes, --route string[] optional
    • Routes to upload.
    • For example: --route example.com/*.
  • --host string optional
    • Host to forward requests to, defaults to the zone of project.
  • --local-protocol 'http'|'https' (default: http) optional
    • Protocol to listen to requests on.
  • --https-key-path string optional
    • Path to a custom certificate key.
  • --https-cert-path string optional
    • Path to a custom certificate.
  • --local-upstream string optional
    • Host to act as origin in local mode, defaults to dev.host or route.
  • --assets string optional beta
    • Folder of static assets to be served. Replaces Workers Sites. Visit assets for more information.
  • --site string optional deprecated, use `--assets`
    • Folder of static assets for Workers Sites.
  • --site-include string[] optional deprecated
    • Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
  • --site-exclude string[] optional deprecated
    • Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
  • --upstream-protocol 'http'|'https' (default: https) optional
    • Protocol to forward requests to host on.
  • --var key:value\[] optional
    • Array of key:value pairs to inject as variables into your code. The value will always be passed as a string to your Worker.
    • For example, --var "git_hash:'$(git rev-parse HEAD)'" "test:123" makes the git_hash and test variables available in your Worker's env.
    • This flag is an alternative to defining vars in your Wrangler configuration file. If defined in both places, this flag's values will be used.
  • --define key:value\[] optional
    • Array of key:value pairs to replace global identifiers in your code.
    • For example, --define "GIT_HASH:'$(git rev-parse HEAD)'" will replace all uses of GIT_HASH with the actual value at build time.
    • This flag is an alternative to defining define in your Wrangler configuration file. If defined in both places, this flag's values will be used.
  • --tsconfig string optional
    • Path to a custom tsconfig.json file.
  • --minify boolean optional
    • Minify the Worker.
  • --persist-to string optional
    • Specify directory to use for local persistence.
  • --remote boolean (default: false) optional
    • Develop against remote resources and data stored on Cloudflare's network.
  • --test-scheduled boolean (default: false) optional
    • Exposes a /__scheduled fetch route which will trigger a scheduled event (Cron Trigger) for testing during development. To simulate different cron patterns, a cron query parameter can be passed in: /__scheduled?cron=*+*+*+*+* or /cdn-cgi/handler/scheduled?cron=*+*+*+*+*.
  • --log-level 'debug'|'info'|'log'|'warn'|'error|'none' (default: log) optional
    • Specify Wrangler's logging level.
  • --show-interactive-dev-session boolean (default: true if the terminal supports interactivity) optional
    • Show the interactive dev session.
  • --alias Array<string>

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

wrangler dev is a way to locally test your Worker while developing. With wrangler dev running, send HTTP requests to localhost:8787 and your Worker should execute as expected. You will also see console.log messages and exceptions appearing in your terminal.


deploy

Deploy your Worker to Cloudflare.

wrangler deploy [<SCRIPT>] [OPTIONS]
  • SCRIPT string
    • The path to an entry point for your Worker. Only required if your Wrangler configuration file does not include a main key (for example, main = "index.js").
  • --name string optional
    • Name of the Worker.
  • --no-bundle boolean (default: false) optional
    • Skip Wrangler's build steps. Particularly useful when using custom builds. Refer to Bundling for more information.
  • --env string optional
    • Perform on a specific environment.
  • --outdir string optional
    • Path to directory where Wrangler will write the bundled Worker files.
  • --compatibility-date string optional
    • A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used.
  • --compatibility-flags, --compatibility-flag string[] optional
    • Flags to use for compatibility checks.
  • --latest boolean (default: true) optional
    • Use the latest version of the Workers runtime.
  • --assets string optional beta
    • Folder of static assets to be served. Replaces Workers Sites. Visit assets for more information.
  • --site string optional deprecated, use `--assets`
    • Folder of static assets for Workers Sites.
  • --site-include string[] optional deprecated
    • Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
  • --site-exclude string[] optional deprecated
    • Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
  • --var key:value\[] optional
    • Array of key:value pairs to inject as variables into your code. The value will always be passed as a string to your Worker.
    • For example, --var git_hash:$(git rev-parse HEAD) test:123 makes the git_hash and test variables available in your Worker's env.
    • This flag is an alternative to defining vars in your Wrangler configuration file. If defined in both places, this flag's values will be used.
  • --define key:value\[] optional
    • Array of key:value pairs to replace global identifiers in your code.
    • For example, --define GIT_HASH:$(git rev-parse HEAD) will replace all uses of GIT_HASH with the actual value at build time.
    • This flag is an alternative to defining define in your Wrangler configuration file. If defined in both places, this flag's values will be used.
  • --triggers, --schedule, --schedules string[] optional
  • --routes, --route string[] optional
    • Routes where this Worker will be deployed.
    • For example: --route example.com/*.
  • --tsconfig string optional
    • Path to a custom tsconfig.json file.
  • --minify boolean optional
    • Minify the bundled Worker before deploying.
  • --dry-run boolean (default: false) optional
    • Compile a project without actually deploying to live servers. Combined with --outdir, this is also useful for testing the output of npx wrangler deploy. It also gives developers a chance to upload our generated sourcemap to a service like Sentry, so that errors from the Worker can be mapped against source code, but before the service goes live.
  • --keep-vars boolean (default: false) optional
    • It is recommended best practice to treat your Wrangler developer environment as a source of truth for your Worker configuration, and avoid making changes via the Cloudflare dashboard.
    • If you change your environment variables in the Cloudflare dashboard, Wrangler will override them the next time you deploy. If you want to disable this behaviour set keep-vars to true.
    • Secrets are never deleted by a deployment whether this flag is true or false.
  • --dispatch-namespace string optional
  • --metafile string optional
    • Specify a file to write the build metadata from esbuild to. If flag is used without a path string, this defaults to bundle-meta.json inside the directory specified by --outdir. This can be useful for understanding the bundle size.
  • --containers-rollout immediate | gradual optional
    • Specify the rollout strategy for Containers associated with the Worker. If set to immediate, 100% of container instances will be updated in one rollout step, overriding any configuration in rollout_step_percentage. Note that rollout_active_grace_period, if configured, still applies.
    • Defaults to gradual, where the default rollout is 10% then 100% of instances.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

delete

Delete your Worker and all associated Cloudflare developer platform resources.

wrangler delete [<SCRIPT>] [OPTIONS]
  • SCRIPT string
    • The path to an entry point for your Worker. Only required if your Wrangler configuration file does not include a main key (for example, main = "index.js").
  • --name string optional
    • Name of the Worker.
  • --env string optional
    • Perform on a specific environment.
  • --dry-run boolean (default: false) optional
    • Do not actually delete the Worker. This is useful for testing the output of wrangler delete.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

kv namespace

Manage Workers KV namespaces.

kv namespace create

Create a new namespace

Terminal window
npx wrangler kv namespace create [NAMESPACE]
  • --namespace string required

    The name of the new namespace

  • --preview boolean

    Interact with a preview namespace

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv namespace list

Output a list of all KV namespaces associated with your account id

Terminal window
npx wrangler kv namespace list

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv namespace delete

Delete a given namespace.

Terminal window
npx wrangler kv namespace delete
  • --binding string

    The binding name to the namespace to delete from

  • --namespace-id string

    The id of the namespace to delete

  • --preview boolean

    Interact with a preview namespace

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv namespace rename

Rename a KV namespace

Terminal window
npx wrangler kv namespace rename [OLD-NAME]
  • --old-name string

    The current name (title) of the namespace to rename

  • --namespace-id string

    The id of the namespace to rename

  • --new-name string required

    The new name for the namespace

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv key

Manage key-value pairs within a Workers KV namespace.

kv key put

Write a single key/value pair to the given namespace

Terminal window
npx wrangler kv key put [KEY] [VALUE]
  • --key string required

    The key to write to

  • --value string

    The value to write

  • --binding string

    The binding name to the namespace to write to

  • --namespace-id string

    The id of the namespace to write to

  • --preview boolean

    Interact with a preview namespace

  • --ttl number

    Time for which the entries should be visible

  • --expiration number

    Time since the UNIX epoch after which the entry expires

  • --metadata string

    Arbitrary JSON that is associated with a key

  • --path string

    Read value from the file at a given path

  • --local boolean

    Interact with local storage

  • --remote boolean

    Interact with remote storage

  • --persist-to string

    Directory for local persistence

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv key list

Output a list of all keys in a given namespace

Terminal window
npx wrangler kv key list
  • --binding string

    The binding name to the namespace to list

  • --namespace-id string

    The id of the namespace to list

  • --preview boolean default: false

    Interact with a preview namespace

  • --prefix string

    A prefix to filter listed keys

  • --local boolean

    Interact with local storage

  • --remote boolean

    Interact with remote storage

  • --persist-to string

    Directory for local persistence

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv key get

Read a single value by key from the given namespace

Terminal window
npx wrangler kv key get [KEY]
  • --key string required

    The key value to get.

  • --binding string

    The binding name to the namespace to get from

  • --namespace-id string

    The id of the namespace to get from

  • --preview boolean default: false

    Interact with a preview namespace

  • --text boolean default: false

    Decode the returned value as a utf8 string

  • --local boolean

    Interact with local storage

  • --remote boolean

    Interact with remote storage

  • --persist-to string

    Directory for local persistence

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv key delete

Remove a single key value pair from the given namespace

Terminal window
npx wrangler kv key delete [KEY]
  • --key string required

    The key value to delete.

  • --binding string

    The binding name to the namespace to delete from

  • --namespace-id string

    The id of the namespace to delete from

  • --preview boolean

    Interact with a preview namespace

  • --local boolean

    Interact with local storage

  • --remote boolean

    Interact with remote storage

  • --persist-to string

    Directory for local persistence

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv bulk

Manage multiple key-value pairs within a Workers KV namespace in batches.

kv bulk get

Gets multiple key-value pairs from a namespace

Terminal window
npx wrangler kv bulk get [FILENAME]
  • --filename string required

    The file containing the keys to get

  • --binding string

    The binding name to the namespace to get from

  • --namespace-id string

    The id of the namespace to get from

  • --preview boolean

    Interact with a preview namespace

  • --local boolean

    Interact with local storage

  • --remote boolean

    Interact with remote storage

  • --persist-to string

    Directory for local persistence

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv bulk put

Upload multiple key-value pairs to a namespace

Terminal window
npx wrangler kv bulk put [FILENAME]
  • --filename string required

    The file containing the key/value pairs to write

  • --binding string

    The binding name to the namespace to write to

  • --namespace-id string

    The id of the namespace to write to

  • --preview boolean

    Interact with a preview namespace

  • --ttl number

    Time for which the entries should be visible

  • --expiration number

    Time since the UNIX epoch after which the entry expires

  • --metadata string

    Arbitrary JSON that is associated with a key

  • --local boolean

    Interact with local storage

  • --remote boolean

    Interact with remote storage

  • --persist-to string

    Directory for local persistence

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

kv bulk delete

Delete multiple key-value pairs from a namespace

Terminal window
npx wrangler kv bulk delete [FILENAME]
  • --filename string required

    The file containing the keys to delete

  • --binding string

    The binding name to the namespace to delete from

  • --namespace-id string

    The id of the namespace to delete from

  • --preview boolean

    Interact with a preview namespace

  • --force boolean alias: --f

    Do not ask for confirmation before deleting

  • --local boolean

    Interact with local storage

  • --remote boolean

    Interact with remote storage

  • --persist-to string

    Directory for local persistence

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning


r2 bucket

Interact with buckets in an R2 store.

create

Create a new R2 bucket.

wrangler r2 bucket create <NAME>
  • NAME string required
    • The name of the new R2 bucket.
  • --location string optional
    • The optional location hint that determines geographic placement of the R2 bucket.
  • --storage-class 'Standard|InfrequentAccess' optional
    • The default storage class for objects uploaded to the bucket.
  • --jurisdiction string optional

info

Get information about an R2 bucket, including the bucket size and number of objects.

wrangler r2 bucket info <NAME>
  • NAME string required
    • The name of the R2 bucket to get information about.
  • --jurisdiction string optional
  • --json boolean optional
    • Return output as clean JSON.
    • Default: false

delete

Delete an R2 bucket.

wrangler r2 bucket delete <NAME>
  • NAME string required
    • The name of the R2 bucket to delete.

list

List R2 bucket in the current account.

wrangler r2 bucket list

catalog enable

Enable R2 Data Catalog on an R2 bucket.

wrangler r2 bucket catalog enable <NAME> [OPTIONS]
  • NAME string required
    • The name of the bucket to enable R2 Data Catalog for.

catalog disable

Disable R2 Data Catalog on an R2 bucket.

wrangler r2 bucket catalog disable <NAME> [OPTIONS]
  • NAME string required
    • The name of the bucket to disable R2 Data Catalog for.

catalog get

Get the status of R2 Data Catalog for an R2 bucket, including catalog URI and warehouse name.

wrangler r2 bucket catalog get <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket whose data catalog status to retrieve.

cors set

Set the CORS configuration for an R2 bucket from a JSON file.

wrangler r2 bucket cors set <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to set the CORS configuration for.
  • --file string required
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when setting CORS configuration.

cors delete

Clear the CORS configuration for an R2 bucket.

wrangler r2 bucket cors delete <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to delete the CORS configuration for.
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when clearing the CORS configuration.

cors list

List the CORS configuration rules for an R2 bucket.

wrangler r2 bucket cors list <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to list the CORS rules for.
  • --jurisdiction string optional

dev-url enable

Enable public access via the r2.dev URL for an R2 bucket.

wrangler r2 bucket dev-url enable <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to enable public access via its r2.dev URL.
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when enabling public access via r2.dev URL.

dev-url disable

Disable public access via the r2.dev URL for an R2 bucket.

wrangler r2 bucket dev-url disable <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to disable public access via its r2.dev URL.
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when disabling public access via r2.dev URL.

dev-url get

Get the r2.dev URL and status for an R2 bucket.

wrangler r2 bucket dev-url get <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket whose r2.dev URL status to retrieve.
  • --jurisdiction string optional

domain add

Connect a custom domain to an R2 bucket.

wrangler r2 bucket domain add <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to connect a custom domain to.
  • --domain string required
    • The custom domain to connect to the R2 bucket.
  • --zone-id string required
    • The zone ID associated with the custom domain.
  • --min-tls '1.0'|'1.1'|'1.2'|'1.3' optional
    • Set the minimum TLS version for the custom domain (defaults to 1.0 if not set).
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when adding the custom domain.

domain remove

Remove a custom domain from an R2 bucket.

wrangler r2 bucket domain remove <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to remove the custom domain from.
  • --domain string required
    • The custom domain to remove from the R2 bucket.
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when removing the custom domain.

domain update

Update settings for a custom domain connected to an R2 bucket.

wrangler r2 bucket domain update <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket associated with the custom domain to update.
  • --domain string required
    • The custom domain whose settings will be updated.
  • --min-tls '1.0'|'1.1'|'1.2'|'1.3' optional
    • Update the minimum TLS version for the custom domain.
  • --jurisdiction string optional

domain get

Get custom domain connected to an R2 bucket.

wrangler r2 bucket domain get <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket whose custom domain to retrieve.
  • --domain string required
    • The custom domain to get information for.
  • --jurisdiction string optional

domain list

List custom domains for an R2 bucket.

wrangler r2 bucket domain list <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket whose connected custom domains will be listed.
  • --jurisdiction string optional

lifecycle add

Add an object lifecycle rule to an R2 bucket.

wrangler r2 bucket lifecycle add <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to add a lifecycle rule to.
  • --name string optional
    • A unique name for the lifecycle rule, used to identify and manage it. For example: delete-logs-180-days.
  • --prefix string optional
    • Prefix condition for the lifecycle rule (leave empty for all prefixes).
  • --expire-days number optional
    • Sets the lifecycle rule action to expire objects after this number of days. Note you can provide only one of --expire-days or --expire-date.
  • --expire-date string optional
    • Sets the lifecycle rule action to expire objects after this date (YYYY-MM-DD). Note you can provide only one of --expire-days or --expire-date.
  • --ia-transition-days number optional
    • Sets the lifecycle rule action to transition objects to Infrequent Access storage after this number of days. Note you can provide only one of --ia-transition-days or --ia-transition-date.
  • --ia-transition-date string optional
    • Sets the lifecycle rule action to transition objects to Infrequent Access storage after this date (YYYY-MM-DD). Note you can provide only one of --ia-transition-days or --ia-transition-date.
  • --abort-multipart-days number optional
    • Sets the lifecycle rule action to abort incomplete multipart uploads after this number of days.
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when adding the lifecycle rule.

lifecycle remove

Remove an object lifecycle rule from an R2 bucket.

wrangler r2 bucket lifecycle remove <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to remove a lifecycle rule from.
  • --name string required
    • The unique name of the lifecycle rule to remove.
  • --jurisdiction string optional

lifecycle list

List object lifecycle rules for an R2 bucket.

wrangler r2 bucket lifecycle list <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to list lifecycle rules for.
  • --jurisdiction string optional

lifecycle set

Set the object lifecycle configuration for an R2 bucket from a JSON file.

wrangler r2 bucket lifecycle set <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to set lifecycle configuration for.
  • --file string required
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when setting object lifecycle configuration.

lock add

Add a bucket lock rule to an R2 bucket.

wrangler r2 bucket lock add <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to add a bucket lock rule to.
  • --name string optional
    • A unique name for the bucket lock rule, used to identify and manage it. For example: retain-logs-180-days.
  • --prefix string optional
    • Prefix condition for the bucket lock rule (leave empty for all prefixes).
  • --retention-days number optional
    • Sets the number of days to retain objects for. Note you can provide only one of --retention-days, --retention-date, or --retention-indefinite.
  • --retention-date string optional
    • Sets the number of days to retain objects for. Note you can provide only one of --retention-days, --retention-date, or --retention-indefinite.
  • --retention-indefinite string optional
    • Sets the retention period to indefinite — meaning the lock will remain in place until explicitly removed. Note you can provide only one of --retention-days, --retention-date, or --retention-indefinite.
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when adding the bucket lock rule.

lock remove

Remove a bucket lock rule from an R2 bucket.

wrangler r2 bucket lock remove <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to remove a bucket lock rule from.
  • --name string required
    • The unique name of the bucket lock rule to remove.
  • --jurisdiction string optional

lock list

List bucket lock rules for an R2 bucket.

wrangler r2 bucket lock list <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to list bucket locks rules for.
  • --jurisdiction string optional

lock set

Set the bucket lock configuration for an R2 bucket from a JSON file.

wrangler r2 bucket lock set <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to set bucket lock configuration for.
  • --file string required
  • --jurisdiction string optional
  • --force boolean optional
    • Skip confirmation when setting bucket lock configuration.

notification create

Create an event notification rule for an R2 bucket.

wrangler r2 bucket notification create <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to create an event notification rule for.
  • --event-type 'object-create'|'object-delete'[] required
  • --queue string required
    • The name of the queue that will receive event notification messages.
  • --prefix string optional
    • The prefix that an object must match to emit event notifications (note: regular expressions are not supported).
  • --suffix string optional
    • The suffix that an object must match to emit event notifications (note: regular expressions are not supported).
  • --description string optional
    • A description that can be used to identify the event notification rule after creation.

notification delete

Remove an event notification rule from a bucket's event notification configuration.

wrangler r2 bucket notification delete <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to delete an event notification rule for.
  • --queue string required
    • The name of the queue that corresponds to the event notification rule. If no rule is provided, all event notification rules associated with the queue will be deleted.
  • --rule string optional
    • The ID of the event notification rule to delete.

notification list

List the event notification rules for a bucket.

wrangler r2 bucket notification list <NAME>
  • NAME string required
    • The name of the R2 bucket to get event notification rules for.

sippy enable

Enable Sippy incremental migration for a bucket.

wrangler r2 bucket sippy enable <NAME> [OPTIONS]
  • NAME string required
    • The name of the R2 bucket to enable Sippy.
  • --provider 'AWS'|'GCS' required
    • The provider of your source object storage bucket.
  • --bucket string required
    • The name of your source object storage bucket.
  • --r2-key-id string required
    • Your R2 Access Key ID. Requires read and write access.
  • --r2-secret-access-key string required
    • Your R2 Secret Access Key. Requires read and write access.
  • --jurisdiction string optional
  • AWS S3 provider-specific options:
  • --key-id string optional
  • --secret-access-key string optional
  • --region string optional
    • The AWS region where your S3 bucket is located. For example: us-west-2.
  • Google Cloud Storage provider-specific options:
  • --service-account-key-file string optional
    • The path to your Google Cloud service account key JSON file. This will read the service account key file and populate client_email and private_key options. Requires read and list access.
  • --client-email string optional
  • --private-key string optional
  • Note that you must provide either service-account-key-file or client_email and private_key for this command to run successfully.

sippy disable

Disable Sippy incremental migration for a bucket.

wrangler r2 bucket sippy disable <NAME>
  • NAME string required
    • The name of the R2 bucket to disable Sippy.

sippy get

Get the status of Sippy incremental migration for a bucket.

wrangler r2 bucket sippy get <NAME>
  • NAME string required
    • The name of the R2 bucket to get the status of Sippy.

r2 object

Interact with R2 objects.

get

Fetch an object from an R2 bucket.

wrangler r2 object get <OBJECT_PATH> [OPTIONS]
  • OBJECT_PATH string required
    • The source object path in the form of {bucket}/{key}.
  • --local boolean (default: true) optional
    • Interact with locally persisted data.
  • --remote boolean (default: false) optional
    • Interact with remote storage.
  • --persist-to string optional
    • Specify directory for locally persisted data.

put

Create an object in an R2 bucket.

wrangler r2 object put <OBJECT_PATH> [OPTIONS]
  • OBJECT_PATH string required
    • The destination object path in the form of {bucket}/{key}.
  • --file string optional
    • The path of the file to upload. Note you must provide either --file or --pipe.
  • --pipe boolean optional
    • Enables the file to be piped in, rather than specified with the --file option. Note you must provide either --file or --pipe.
  • --content-type string optional
    • A standard MIME type describing the format of the object data.
  • --content-disposition string optional
    • Specifies presentational information for the object.
  • --content-encoding string optional
    • Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
  • --content-language string optional
    • The language the content is in.
  • --cache-control string optional
    • Specifies caching behavior along the request/reply chain.
  • --expires string optional
    • The date and time at which the object is no longer cacheable.
  • --local boolean (default: true) optional
    • Interact with locally persisted data.
  • --remote boolean (default: false) optional
    • Interact with remote storage.
  • --persist-to string optional
    • Specify directory for locally persisted data.

delete

Delete an object in an R2 bucket.

wrangler r2 object delete <OBJECT_PATH> [OPTIONS]
  • OBJECT_PATH string required
    • The destination object path in the form of {bucket}/{key}.
  • --local boolean (default: true) optional
    • Interact with locally persisted data.
  • --remote boolean (default: false) optional
    • Interact with remote storage.
  • --persist-to string optional
    • Specify directory for locally persisted data.

secret

Manage the secret variables for a Worker.

This action creates a new version of the Worker and deploys it immediately. To only create a new version of the Worker, use the wrangler versions secret commands.

put

Create or replace a secret for a Worker.

wrangler secret put <KEY> [OPTIONS]
  • KEY string required
    • The variable name for this secret to be accessed in the Worker.
  • --name string optional
  • --env string optional
    • Perform on a specific environment.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

When running this command, you will be prompted to input the secret's value:

Terminal window
npx wrangler secret put FOO
? Enter a secret value: › ***
🌀 Creating the secret for script worker-app
Success! Uploaded secret FOO

The put command can also receive piped input. For example:

Terminal window
echo "-----BEGIN PRIVATE KEY-----\nM...==\n-----END PRIVATE KEY-----\n" | wrangler secret put PRIVATE_KEY

delete

Delete a secret for a Worker.

wrangler secret delete <KEY> [OPTIONS]
  • KEY string required
    • The variable name for this secret to be accessed in the Worker.
  • --name string optional
  • --env string optional
    • Perform on a specific environment.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

list

List the names of all the secrets for a Worker.

wrangler secret list [OPTIONS]
  • --name string optional
  • --env string optional
    • Perform on a specific environment

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

The following is an example of listing the secrets for the current Worker.

Terminal window
npx wrangler secret list
[
{
"name": "FOO",
"type": "secret_text"
}
]

secret bulk

Upload multiple secrets for a Worker at once.

wrangler secret bulk [<FILENAME>] [OPTIONS]
  • FILENAME string optional
    • A file containing either JSON or the .env format
    • The JSON file containing key-value pairs to upload as secrets, in the form {"SECRET_NAME": "secret value", ...}.
    • The .env file containing key-value pairs to upload as secrets, in the form SECRET_NAME=secret value.
    • If omitted, Wrangler expects to receive input from stdin rather than a file.
  • --name string optional
  • --env string optional
    • Perform on a specific environment.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

The following is an example of uploading secrets from a JSON file redirected to stdin. When complete, the output summary will show the number of secrets uploaded and the number of secrets that failed to upload.

{
"secret-name-1": "secret-value-1",
"secret-name-2": "secret-value-2"
}
Terminal window
npx wrangler secret bulk < secrets.json
🌀 Creating the secrets for the Worker "script-name"
Successfully created secret for key: secret-name-1
...
🚨 Error uploading secret for key: secret-name-1
Successfully created secret for key: secret-name-2
Finished processing secrets JSON file:
1 secrets successfully uploaded
🚨 1 secrets failed to upload

secrets-store secret

With the release of Secrets Store in open beta, you can use the following commands to manage your account secrets.

create

Create a secret within a store.

wrangler secrets-store secret create <STORE_ID> [OPTIONS]
  • STORE_ID string required
  • --name string required
    • A descriptive name for the account-level secret. Cannot contain spaces.
  • --value string test only
    • Value of the secret.
  • --scopes string required
    • Which services will have access to the account-level secret. Currently, only workers is available.
  • --comment string optional
    • Additional information about the account-level secret.
  • --remote boolean (default: false) optional
    • Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append --remote to your commands.

The following is an example of using the create command to create an account-level secret.

Terminal window
npx wrangler secrets-store secret create 8f7a1cdced6342c18d223ece462fd88d --name ServiceA_key-1 --scopes workers --remote
Enter a secret value: ***
🔐 Creating secret... (Name: ServiceA_key-1, Value: REDACTED, Scopes: workers, Comment: undefined)
Select an account: My account
Created secret! (ID: 13bc7498c6374a4e9d13be091c3c65f1)

update

Update a secret within a store.

wrangler secrets-store secret update <STORE_ID> [OPTIONS]
  • STORE_ID string required
    • The ID of the secrets store that contains the secret you are updating.
  • --secret-id string required
    • The ID of the secret to update.
  • --value string test only
    • Updated value of the secret.
  • --scopes string required
    • Which services will have access to the account-level secret. Currently, only workers is available.
  • --comment string optional
    • Updated comment for the account-level secret.
  • --remote boolean (default: false) optional
    • Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append --remote to your commands.

duplicate

Duplicate a secret within a store. Use this command to create a new secret that holds the same secret value as an existing secret.

wrangler secrets-store secret duplicate <STORE_ID> [OPTIONS]
  • STORE_ID string required
    • The ID of the secrets store that contains the secret you are duplicating.
  • --secret-id string required
    • The ID of the secret you are duplicating.
  • --name string required
    • A name for the new secret. Cannot contain spaces.
  • --scopes string required
    • Which services will have access to the new account-level secret. Currently, only workers is available.
  • --comment string optional
    • Additional information about the new account-level secret.
  • --remote boolean (default: false) optional
    • Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append --remote to your commands.

get

Get information on a secret within a store.

wrangler secrets-store secret get <STORE_ID> [OPTIONS]
  • STORE_ID string required
    • The ID of the secrets store that contains the secret you want to get.
  • --secret-id string required
    • The ID of the secret you want to get.
  • --remote boolean (default: false) optional
    • Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append --remote to your commands.

The following is an example with the expected output:

Terminal window
npx wrangler secrets-store secret get 8f7a1cdced6342c18d223ece462fd88d --secret-id 13bc7498c6374a4e9d13be091c3c65f1 --remote
🔐 Getting secret... (ID: 13bc7498c6374a4e9d13be091c3c65f1)
Select an account: My account
| Name | ID | StoreID | Comment | Scopes | Status | Created | Modified |
|-----------------------------|-------------------------------------|-------------------------------------|---------|---------|---------|------------------------|------------------------|
| ServiceA_key-1 | 13bc7498c6374a4e9d13be091c3c65f1 | 8f7a1cdced6342c18d223ece462fd88d | | workers | active | 4/9/2025, 10:06:01 PM | 4/15/2025, 09:13:05 AM |

delete

Delete a secret within a store.

wrangler secrets-store secret delete <STORE_ID> [OPTIONS]
  • STORE_ID string required
    • The ID of the secrets store that contains the secret you are deleting.
  • --secret-id string required
    • The ID of the secret you are deleting.
  • --remote boolean (default: false) optional
    • Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append --remote to your commands.

list

List secrets within a store.

wrangler secrets-store secret list <STORE_ID>
  • STORE_ID string required

secrets-store store

Use the following commands to manage your store.

create

Create a store within Secrets Store.

wrangler secrets-store store create <name>
  • name string required
    • A descriptive name for the account-level secret. Cannot contain spaces.
  • --remote boolean (default: false) required
    • Execute the command against the remote Secrets Store.

The following is an example of using the create command to create a store.

Terminal window
npx wrangler secrets-store store create default --remote
🔐 Creating store... (Name: default)
Created store! (Name: default, ID: 2e2a82d317134506b58defbe16982d54)

delete

Delete a store within Secrets Store.

wrangler secrets-store store delete <STORE_ID>
  • STORE_ID string required
  • --remote boolean (default: false) required
    • Execute the command against the remote Secrets Store.

The following is an example of using the delete command to delete a store.

Terminal window
npx wrangler secrets-store store delete d2dafaeac9434de2b6d08b292ce08211 --remote
🔐 Deleting store... (Name: d2dafaeac9434de2b6d08b292ce08211)
Deleted store! (ID: d2dafaeac9434de2b6d08b292ce08211)

list

List the stores within an account.

wrangler secrets-store store list
  • --remote boolean (default: false) required
    • Execute the command against the remote Secrets Store.

The following is an example of using the list command to list stores.

Terminal window
npx wrangler secrets-store store list --remote
🔐 Listing stores...
┌─────────┬──────────────────────────────────┬──────────────────────────────────┬──────────────────────┬──────────────────────┐
Name ID AccountID Created Modified
├─────────┼──────────────────────────────────┼──────────────────────────────────┼──────────────────────┼──────────────────────┤
default 8876bad33f164462bf0743fe8adf98f4 REDACTED 4/9/2025, 1:11:48 PM 4/9/2025, 1:11:48 PM
└─────────┴──────────────────────────────────┴──────────────────────────────────┴──────────────────────┴──────────────────────┘

workflows

Manage and configure Workflows.

list

Lists the registered Workflows for this account.

Terminal window
wrangler workflows list
  • --page number optional
    • Show a specific page from the listing. You can configure page size using "per-page".
  • --per-page number optional
    • Configure the maximum number of Workflows to show per page.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

instances

Manage and interact with specific instances of a Workflow.

instances list

List Workflow instances.

Terminal window
wrangler workflows instances list <WORKFLOW_NAME> [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

instances describe

Describe a specific instance of a Workflow, including its current status, any persisted state, and per-step outputs.

Terminal window
wrangler workflows instances describe <WORKFLOW_NAME> [ID] [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.
  • ID string (default: latest) optional
    • The ID of a Workflow instance. You can optionally provide latest to refer to the most recently created instance of a Workflow. Defaults to latest if no ID is provided.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.
Terminal window
# Passing `latest` instead of an explicit ID will describe the most recently queued instance
wrangler workflows instances describe my-workflow latest
Workflow Name: my-workflow
Instance Id: 51c73fc8-7fd5-47d9-bd82-9e301506ee72
Version Id: cedc33a0-11fa-4c26-8a8e-7d28d381a291
Status: Completed
Trigger: 🌎 API
Queued: 10/16/2024, 2:00:39 PM
Success: Yes
Start: 10/16/2024, 2:00:39 PM
End: 10/16/2024, 2:01:40 PM
Duration: 1 minute
# Remaining output truncated

instances terminate

Terminate (permanently stop) a Workflow instance.

Terminal window
wrangler workflows instances terminate <WORKFLOW_NAME> <ID> [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.
  • ID string required
    • The ID of a Workflow instance.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

instances pause

Pause (until resumed) a Workflow instance.

Terminal window
wrangler workflows instances pause <WORKFLOW_NAME> <ID> [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.
  • ID string required
    • The ID of a Workflow instance.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

instances resume

Resume a paused Workflow instance.

Terminal window
wrangler workflows instances resume <WORKFLOW_NAME> <ID> [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.
  • ID string required
    • The ID of a Workflow instance.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

describe

Terminal window
wrangler workflows describe <WORKFLOW_NAME> [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

delete

Delete a Workflow and all its instances.

Terminal window
wrangler workflows delete <WORKFLOW_NAME> [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.
Terminal window
wrangler workflows instances delete my-workflow

trigger

Trigger (create) a Workflow instance.

Terminal window
wrangler workflows trigger <WORKFLOW_NAME> <PARAMS> [OPTIONS]
  • WORKFLOW_NAME string required
    • The name of a registered Workflow.
  • PARAMS string optional
    • The parameters to pass to the Workflow as an event. Must be a JSON-encoded string.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.
Terminal window
# Pass optional params to the Workflow.
wrangler workflows trigger my-workflow '{"hello":"world"}'

tail

🦚 Start a log tailing session for a Worker

Terminal window
npx wrangler tail [WORKER]
  • --worker string

    Name or route of the worker to tail

  • --format "json" | "pretty"

    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

  • --sampling-rate number

    Adds a percentage of requests to log sampling rate

  • --search string

    Filter by a text match in console.log messages

  • --ip string

    Filter by the IP address the request originates from. Use "self" to filter for your own IP

  • --version-id string

    Filter by Worker version

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-remote-bindings boolean aliases: --x-remote-bindings

    Experimental: Enable Remote Bindings

  • --experimental-provision boolean aliases: --x-provision

    Experimental: Enable automatic resource provisioning

After starting wrangler tail, you will receive a live feed of console and exception logs for each request your Worker receives.

If your Worker has a high volume of traffic, the tail might enter sampling mode. This will cause some of your messages to be dropped and a warning to appear in your tail logs. To prevent messages from being dropped, add the options listed above to filter the volume of tail messages.

If sampling persists after using options to filter messages, consider using instant logs.


pages

Configure Cloudflare Pages.

dev

Develop your full-stack Pages application locally.

wrangler pages dev [<DIRECTORY>] [OPTIONS]
  • DIRECTORY string optional
    • The directory of static assets to serve.
  • --local boolean optional (default: true)
    • Run on your local machine.
  • --ip string optional
    • IP address to listen on, defaults to localhost.
  • --port number optional (default: 8788)
    • The port to listen on (serve from).
  • --config, -c string[] optional
    • Path(s) to Wrangler configuration file. If not provided, Wrangler will use the nearest config file based on your current working directory.
    • You can provide additional configuration files in order to run Workers alongside your Pages project, like this: wrangler pages dev -c ./wrangler.toml -c ../other-worker/wrangler.toml. The first argument must point to your Pages configuration file, and the subsequent configurations will be accessible via a Service binding from your Pages project.
  • --binding string[] optional
    • Bind an environment variable or secret (for example, --binding <VARIABLE_NAME>=<VALUE>).
  • --kv string[] optional
    • Binding name of KV namespace to bind (for example, --kv <BINDING_NAME>).
  • --r2 string[] optional
    • Binding name of R2 bucket to bind (for example, --r2 <BINDING_NAME>).
  • --d1 string[] optional
    • Binding name of D1 database to bind (for example, --d1 <BINDING_NAME>).
  • --do string[] optional
    • Binding name of Durable Object to bind (for example, --do <BINDING_NAME>=<CLASS>).
  • --live-reload boolean optional (default: false)
    • Auto reload HTML pages when change is detected.
  • --compatibility-flag string[] optional
    • Runtime compatibility flags to apply.
  • --compatibility-date string optional
    • Runtime compatibility date to apply.
  • --show-interactive-dev-session boolean optional (default: true if the terminal supports interactivity)
    • Show the interactive dev session.
  • --https-key-path string optional
    • Path to a custom certificate key.
  • --https-cert-path string optional
    • Path to a custom certificate.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

download config

Download your Pages project config as a Wrangler configuration file.

wrangler pages download config <PROJECT_NAME>

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

project list

List your Pages projects.

wrangler pages project list

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

project create

Create a new Cloudflare Pages project.

wrangler pages project create <PROJECT_NAME> [OPTIONS]
  • PROJECT_NAME string required
    • The name of your Pages project.
  • --production-branch string optional
    • The name of the production branch of your project.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

project delete

Delete a Cloudflare Pages project.

wrangler pages project delete <PROJECT_NAME> [OPTIONS]
  • PROJECT_NAME string required
    • The name of the Pages project to delete.
  • --yes boolean optional
    • Answer "yes" to confirmation prompt.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

deployment list

List deployments in your Cloudflare Pages project.

wrangler pages deployment list [--project-name <PROJECT_NAME>]
  • --project-name string optional
    • The name of the project you would like to list deployments for.
  • --environment 'production'|'preview' optional
    • Environment type to list deployments for.
  • --json boolean optional
    • Whether to output the list in JSON format.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

deployment tail

Start a session to livestream logs from your deployed Pages Functions.

wrangler pages deployment tail [<DEPLOYMENT>] [OPTIONS]
  • DEPLOYMENT string optional
    • ID or URL of the deployment to tail. Specify by environment if deployment ID is unknown.
  • --project-name string optional
    • The name of the project you would like to tail.
  • --environment 'production'|'preview' optional
    • When not providing a specific deployment ID, specifying environment will grab the latest production or preview deployment.
  • --format 'json'|'pretty' optional
    • The format of the log entries.
  • --status 'ok'|'error'|'canceled' optional
    • Filter by invocation status.
  • --header string optional
    • Filter by HTTP header.
  • --method string optional
    • Filter by HTTP method.
  • --sampling-rate number optional
    • Add a percentage of requests to log sampling rate.
  • --search string optional
    • Filter by a text match in console.log messages.
  • --ip (string|'self')\[] optional
    • Filter by the IP address the request originates from. Use "self" to show only messages from your own IP.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

After starting wrangler pages deployment tail, you will receive a live stream of console and exception logs for each request your Functions receive.

deploy

Deploy a directory of static assets as a Pages deployment.

wrangler pages deploy <BUILD_OUTPUT_DIRECTORY> [OPTIONS]
  • BUILD_OUTPUT_DIRECTORY string optional
  • --project-name string optional
    • The name of the project you want to deploy to.
  • --branch string optional
    • The name of the branch you want to deploy to.
  • --commit-hash string optional
    • The SHA to attach to this deployment.
  • --commit-message string optional
    • The commit message to attach to this deployment.
  • --commit-dirty boolean optional
    • Whether or not the workspace should be considered dirty for this deployment.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

secret put

Create or update a secret for a Pages project.

wrangler pages secret put <KEY> [OPTIONS]
  • KEY string required
    • The variable name for this secret to be accessed in the Pages project.
  • --project-name string optional
    • The name of your Pages project.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

secret delete

Delete a secret from a Pages project.

wrangler pages secret delete <KEY> [OPTIONS]
  • KEY string required
    • The variable name for this secret to be accessed in the Pages project.
  • --project-name string optional
    • The name of your Pages project.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

secret list

List the names of all the secrets for a Pages project.

wrangler pages secret list [OPTIONS]
  • --project-name string optional
    • The name of your Pages project.

The following global flags work on every command:

  • --help boolean
    • Show help.
  • --config string (not supported by Pages)
  • --cwd string
    • Run as if Wrangler was started in the specified directory instead of the current working directory.

secret bulk