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.r2 sql- Query tables in R2 Data Catalog with R2 SQL.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.
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.
npx wrangler <COMMAND> <SUBCOMMAND> [PARAMETERS] [OPTIONS]yarn wrangler <COMMAND> <SUBCOMMAND> [PARAMETERS] [OPTIONS]pnpm 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:
npm run deployyarn run deploypnpm run deployOpen the Cloudflare developer documentation in your default browser.
npx wrangler docs [SEARCH]pnpm wrangler docs [SEARCH]yarn wrangler docs [SEARCH]-
[SEARCH]stringEnter search terms (e.g. the wrangler command) you want to know more about
-
--yesboolean alias: --yTakes you to the docs, even if search fails
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
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]NAMEstring optional (default: name of working directory)- The name of the Workers project. This is both the directory name and
nameproperty in the generated Wrangler configuration.
- The name of the Workers project. This is both the directory name and
--yesboolean optional- Answer yes to any prompts for new projects.
--from-dashstring 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-dashcommand will not automatically sync changes made to the dashboard after the command is used. Therefore, it is recommended that you continue using the CLI.
- Fetch a Worker initialized from the dashboard. This is done by passing the flag and the Worker name.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Interact with Cloudflare's Container Platform.
Build a Container image from a Dockerfile.
wrangler containers build [PATH] [OPTIONS]PATHstring optional- Path for the directory containing the Dockerfile to build.
-t, --tagstring required- Name and optionally a tag (format: "name:tag").
--path-to-dockerstring optional- Path to your docker binary if it's not on
$PATH. - Default: "docker"
- Path to your docker binary if it's not on
-p, --pushboolean optional- Push the built image to Cloudflare's managed registry.
- Default: false
Delete a Container (application).
wrangler containers delete <CONTAINER_ID> [OPTIONS]CONTAINER_IDstring required- The ID of the Container to delete.
Perform operations on images in your containers registry.
List images in your containers registry.
wrangler containers images list [OPTIONS]--filterstring optional- Regex to filter results.
--jsonboolean optional- Return output as clean JSON.
- Default: false
Remove an image from your containers registry.
wrangler containers images delete [IMAGE] [OPTIONS]IMAGEstring required- Image to delete of the form
IMAGE:TAG
- Image to delete of the form
Get information about a specific Container, including top-level details and a list of instances.
wrangler containers info <CONTAINER_ID> [OPTIONS]CONTAINER_IDstring required- The ID of the Container to get information about.
List the Containers in your account.
wrangler containers list [OPTIONS]Push a tagged image to a Cloudflare managed registry, which is automatically integrated with your account.
wrangler containers push [TAG] [OPTIONS]TAGstring required- The name and tag of the container image to push.
--path-to-dockerstring optional- Path to your docker binary if it's not on
$PATH. - Default: "docker"
- Path to your docker binary if it's not on
Interact with Cloudflare's D1 service.
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_NAMEstring required- The name of the new D1 database.
--locationstring 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), andenam(Eastern North America).
Get information about a D1 database, including the current database size and state.
wrangler d1 info <DATABASE_NAME> [OPTIONS]DATABASE_NAMEstring required- The name of the D1 database to get information about.
--jsonboolean optional- Return output as JSON rather than a table.
List all D1 databases in your account.
wrangler d1 list [OPTIONS]--jsonboolean optional- Return output as JSON rather than a table.
Delete a D1 database.
wrangler d1 delete <DATABASE_NAME> [OPTIONS]DATABASE_NAMEstring required- The name of the D1 database to delete.
-y, --skip-confirmationboolean optional- Skip deletion confirmation prompt.
Execute a query on a D1 database.
wrangler d1 execute <DATABASE_NAME> [OPTIONS]DATABASE_NAMEstring required- The name of the D1 database to execute a query on.
--commandstring optional- The SQL query you wish to execute.
--filestring optional- Path to the SQL file you wish to execute.
-y, --yesboolean optional- Answer
yesto any prompts.
- Answer
--localboolean (default: true) optional- Execute commands/files against a local database for use with wrangler dev.
--remoteboolean (default: false) optional- Execute commands/files against a remote D1 database for use with remote bindings or your deployed Worker.
--persist-tostring optional- Specify directory to use for local persistence (for use in combination with
--local).
- Specify directory to use for local persistence (for use in combination with
--jsonboolean optional- Return output as JSON rather than a table.
--previewboolean optional- Execute commands/files against a preview D1 database (as defined by
preview_database_idin the Wrangler configuration file).
- Execute commands/files against a preview D1 database (as defined by
Export a D1 database or table's schema and/or content to a .sql file.
wrangler d1 export <DATABASE_NAME> [OPTIONS]DATABASE_NAMEstring required- The name of the D1 database to export.
--localboolean (default: true) optional- Export from a local database for use with wrangler dev.
--remoteboolean (default: false) optional- Export from a remote D1 database.
--outputstring required- Path to the SQL file for your export.
--tablestring optional- The name of the table within a D1 database to export.
--no-databoolean (default: false) optional- Controls whether export SQL file contains database data. Note that
--no-data=trueis not recommended due to a known wrangler limitation that intreprets the value as false.
- Controls whether export SQL file contains database data. Note that
--no-schemaboolean (default: false) optional- Controls whether export SQL file contains database schema. Note that
--no-schema=trueis not recommended due to a known wrangler limitation that intreprets the value as false.
- Controls whether export SQL file contains database schema. Note that
Restore a database to a specific point-in-time using Time Travel.
wrangler d1 time-travel restore <DATABASE_NAME> [OPTIONS]DATABASE_NAMEstring required- The name of the D1 database to execute a query on.
--bookmarkstring optional- A D1 bookmark representing the state of a database at a specific point in time.
--timestampstring optional- A UNIX timestamp or JavaScript date-time
stringwithin the last 30 days.
- A UNIX timestamp or JavaScript date-time
--jsonboolean optional- Return output as JSON rather than a table.
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_NAMEstring required- The name of the D1 database to execute a query on.
--timestampstring optional- A UNIX timestamp or JavaScript date-time
stringwithin the last 30 days.
- A UNIX timestamp or JavaScript date-time
--jsonbboolean optional- Return output as JSON rather than a table.
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_NAMEstring required- The name of the D1 database you wish to create a migration for.
MIGRATION_NAMEstring required- A descriptive name for the migration you wish to create.
View a list of unapplied migration files.
wrangler d1 migrations list <DATABASE_NAME> [OPTIONS]DATABASE_NAMEstring required- The name of the D1 database you wish to list unapplied migrations for.
--localboolean optional- Show the list of unapplied migration files on your locally persisted D1 database.
--remoteboolean (default: false) optional- Show the list of unapplied migration files on your remote D1 database.
--persist-tostring optional- Specify directory to use for local persistence (for use in combination with
--local).
- Specify directory to use for local persistence (for use in combination with
--previewboolean optional- Show the list of unapplied migration files on your preview D1 database (as defined by
preview_database_idin the Wrangler configuration file).
- Show the list of unapplied migration files on your preview D1 database (as defined by
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_NAMEstring required- The name of the D1 database you wish to apply your migrations on.
--envstring optional- Specify which environment configuration to use for D1 binding
--localboolean (default: true) optional- Execute any unapplied migrations on your locally persisted D1 database.
--remoteboolean (default: false) optional- Execute any unapplied migrations on your remote D1 database.
--persist-tostring optional- Specify directory to use for local persistence (for use in combination with
--local).
- Specify directory to use for local persistence (for use in combination with
--previewboolean optional- Execute any unapplied migrations on your preview D1 database (as defined by
preview_database_idin the Wrangler configuration file).
- Execute any unapplied migrations on your preview D1 database (as defined by
Manage Hyperdrive database configurations.
Create a Hyperdrive config
npx wrangler hyperdrive create [NAME]pnpm wrangler hyperdrive create [NAME]yarn wrangler hyperdrive create [NAME]-
[NAME]string requiredThe name of the Hyperdrive config
-
--connection-stringstringThe connection string for the database you want Hyperdrive to connect to - ex: protocol://user:password@host:port/database
-
--origin-hoststring alias: --hostThe host of the origin database
-
--origin-portnumber alias: --portThe port number of the origin database
-
--origin-schemestring alias: --scheme default: postgresqlThe scheme used to connect to the origin database
-
--databasestringThe name of the database within the origin database
-
--origin-userstring alias: --userThe username used to connect to the origin database
-
--origin-passwordstring alias: --passwordThe password used to connect to the origin database
-
--access-client-idstringThe Client ID of the Access token to use when connecting to the origin database
-
--access-client-secretstringThe Client Secret of the Access token to use when connecting to the origin database
-
--caching-disabledbooleanDisables the caching of SQL responses
-
--max-agenumberSpecifies max duration for which items should persist in the cache, cannot be set when caching is disabled
-
--swrnumberIndicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled
-
--ca-certificate-idstring alias: --ca-certificate-uuidSets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate.
-
--mtls-certificate-idstring alias: --mtls-certificate-uuidSets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates.
-
--sslmodestringSets CA sslmode for connecting to database.
-
--origin-connection-limitnumberThe (soft) maximum number of connections that Hyperdrive may establish to the origin database
-
--bindingstringThe binding name of this resource in your Worker
-
--use-remotebooleanUse a remote binding when adding the newly created resource to your config
-
--update-configbooleanAutomatically update your config file with the newly added resource
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a Hyperdrive config
npx wrangler hyperdrive delete [ID]pnpm wrangler hyperdrive delete [ID]yarn wrangler hyperdrive delete [ID]-
[ID]string requiredThe ID of the Hyperdrive config
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get a Hyperdrive config
npx wrangler hyperdrive get [ID]pnpm wrangler hyperdrive get [ID]yarn wrangler hyperdrive get [ID]-
[ID]string requiredThe ID of the Hyperdrive config
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List Hyperdrive configs
npx wrangler hyperdrive listpnpm wrangler hyperdrive listyarn wrangler hyperdrive listGlobal flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Update a Hyperdrive config
npx wrangler hyperdrive update [ID]pnpm wrangler hyperdrive update [ID]yarn wrangler hyperdrive update [ID]-
[ID]string requiredThe ID of the Hyperdrive config
-
--namestringGive your config a new name
-
--connection-stringstringThe connection string for the database you want Hyperdrive to connect to - ex: protocol://user:password@host:port/database
-
--origin-hoststring alias: --hostThe host of the origin database
-
--origin-portnumber alias: --portThe port number of the origin database
-
--origin-schemestring alias: --schemeThe scheme used to connect to the origin database
-
--databasestringThe name of the database within the origin database
-
--origin-userstring alias: --userThe username used to connect to the origin database
-
--origin-passwordstring alias: --passwordThe password used to connect to the origin database
-
--access-client-idstringThe Client ID of the Access token to use when connecting to the origin database
-
--access-client-secretstringThe Client Secret of the Access token to use when connecting to the origin database
-
--caching-disabledbooleanDisables the caching of SQL responses
-
--max-agenumberSpecifies max duration for which items should persist in the cache, cannot be set when caching is disabled
-
--swrnumberIndicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled
-
--ca-certificate-idstring alias: --ca-certificate-uuidSets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate.
-
--mtls-certificate-idstring alias: --mtls-certificate-uuidSets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates.
-
--sslmodestringSets CA sslmode for connecting to database.
-
--origin-connection-limitnumberThe (soft) maximum number of connections that Hyperdrive may establish to the origin database
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Interact with a Vectorize vector database.
Create a Vectorize index
npx wrangler vectorize create [NAME]pnpm wrangler vectorize create [NAME]yarn wrangler vectorize create [NAME]-
[NAME]string requiredThe name of the Vectorize index to create (must be unique).
-
--dimensionsnumberThe dimension size to configure this index for, based on the output dimensions of your ML model.
-
--metricstringThe distance metric to use for searching within the index.
-
--presetstringThe name of an preset representing an embeddings model: Vectorize will configure the dimensions and distance metric for you when provided.
-
--descriptionstringAn optional description for this index.
-
--jsonboolean default: falseReturn output as clean JSON
-
--deprecated-v1boolean default: falseCreate a deprecated Vectorize V1 index. This is not recommended and indexes created with this option need all other Vectorize operations to have this option enabled.
-
--use-remotebooleanUse a remote binding when adding the newly created resource to your config
-
--update-configbooleanAutomatically update your config file with the newly added resource
-
--bindingstringThe binding name of this resource in your Worker
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a Vectorize index
npx wrangler vectorize delete [NAME]pnpm wrangler vectorize delete [NAME]yarn wrangler vectorize delete [NAME]-
[NAME]string requiredThe name of the Vectorize index
-
--forceboolean alias: --y default: falseSkip confirmation
-
--deprecated-v1boolean default: falseDelete a deprecated Vectorize V1 index.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get a Vectorize index by name
npx wrangler vectorize get [NAME]pnpm wrangler vectorize get [NAME]yarn wrangler vectorize get [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--jsonboolean default: falseReturn output as clean JSON
-
--deprecated-v1boolean default: falseFetch a deprecated V1 Vectorize index. This must be enabled if the index was created with V1 option.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List your Vectorize indexes
npx wrangler vectorize listpnpm wrangler vectorize listyarn wrangler vectorize list-
--jsonboolean default: falseReturn output as clean JSON
-
--deprecated-v1boolean default: falseList deprecated Vectorize V1 indexes for your account.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List vector identifiers in a Vectorize index
npx wrangler vectorize list-vectors [NAME]pnpm wrangler vectorize list-vectors [NAME]yarn wrangler vectorize list-vectors [NAME]-
[NAME]string requiredThe name of the Vectorize index
-
--countnumberMaximum number of vectors to return (1-1000)
-
--cursorstringCursor for pagination to get the next page of results
-
--jsonboolean default: falseReturn output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Query a Vectorize index
npx wrangler vectorize query [NAME]pnpm wrangler vectorize query [NAME]yarn wrangler vectorize query [NAME]-
[NAME]string requiredThe name of the Vectorize index
-
--vectornumberVector to query the Vectorize Index
-
--vector-idstringIdentifier for a vector in the index against which the index should be queried
-
--top-knumber default: 5The number of results (nearest neighbors) to return
-
--return-valuesboolean default: falseSpecify if the vector values should be included in the results
-
--return-metadatastring default: noneSpecify if the vector metadata should be included in the results
-
--namespacestringFilter the query results based on this namespace
-
--filterstringFilter the query results based on this metadata filter.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Insert vectors into a Vectorize index
npx wrangler vectorize insert [NAME]pnpm wrangler vectorize insert [NAME]yarn wrangler vectorize insert [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--filestring requiredA file containing line separated json (ndjson) vector objects.
-
--batch-sizenumber default: 1000Number of vector records to include when sending to the Cloudflare API.
-
--jsonboolean default: falsereturn output as clean JSON
-
--deprecated-v1boolean default: falseInsert into a deprecated V1 Vectorize index. This must be enabled if the index was created with the V1 option.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Upsert vectors into a Vectorize index
npx wrangler vectorize upsert [NAME]pnpm wrangler vectorize upsert [NAME]yarn wrangler vectorize upsert [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--filestring requiredA file containing line separated json (ndjson) vector objects.
-
--batch-sizenumber default: 5000Number of vector records to include in a single upsert batch when sending to the Cloudflare API.
-
--jsonboolean default: falsereturn output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get vectors from a Vectorize index
npx wrangler vectorize get-vectors [NAME]pnpm wrangler vectorize get-vectors [NAME]yarn wrangler vectorize get-vectors [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--idsstring requiredVector identifiers to be fetched from the Vectorize Index. Example:
--ids a 'b' 1 '2'
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete vectors in a Vectorize index
npx wrangler vectorize delete-vectors [NAME]pnpm wrangler vectorize delete-vectors [NAME]yarn wrangler vectorize delete-vectors [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--idsstring requiredVector identifiers to be deleted from the Vectorize Index. Example:
--ids a 'b' 1 '2'
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get additional details about the index
npx wrangler vectorize info [NAME]pnpm wrangler vectorize info [NAME]yarn wrangler vectorize info [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--jsonboolean default: falsereturn output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Enable metadata filtering on the specified property
npx wrangler vectorize create-metadata-index [NAME]pnpm wrangler vectorize create-metadata-index [NAME]yarn wrangler vectorize create-metadata-index [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--propertyNamestring requiredThe name of the metadata property to index.
-
--typestring requiredThe type of metadata property to index. Valid types are 'string', 'number' and 'boolean'.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List metadata properties on which metadata filtering is enabled
npx wrangler vectorize list-metadata-index [NAME]pnpm wrangler vectorize list-metadata-index [NAME]yarn wrangler vectorize list-metadata-index [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--jsonboolean default: falsereturn output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete metadata indexes
npx wrangler vectorize delete-metadata-index [NAME]pnpm wrangler vectorize delete-metadata-index [NAME]yarn wrangler vectorize delete-metadata-index [NAME]-
[NAME]string requiredThe name of the Vectorize index.
-
--propertyNamestring requiredThe name of the metadata property to index.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Start a local server for developing your Worker.
wrangler dev [<SCRIPT>] [OPTIONS]SCRIPTstring- The path to an entry point for your Worker. Only required if your Wrangler configuration file does not include a
mainkey (for example,main = "index.js").
- The path to an entry point for your Worker. Only required if your Wrangler configuration file does not include a
--namestring optional- Name of the Worker.
--config,-cstring[] 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-bundleboolean (default: false) optional- Skip Wrangler's build steps. Particularly useful when using custom builds. Refer to Bundling ↗ for more information.
--envstring optional- Perform on a specific environment.
--compatibility-datestring 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-flagstring[] optional- Flags to use for compatibility checks.
--latestboolean (default: true) optional- Use the latest version of the Workers runtime.
--ipstring optional- IP address to listen on, defaults to
localhost.
- IP address to listen on, defaults to
--portnumber optional- Port to listen on.
--inspector-portnumber optional- Port for devtools to connect to.
--routes,--routestring[] optional- Routes to upload.
- For example:
--route example.com/*.
--hoststring 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-pathstring optional- Path to a custom certificate key.
--https-cert-pathstring optional- Path to a custom certificate.
--local-upstreamstring optional- Host to act as origin in local mode, defaults to
dev.hostor route.
- Host to act as origin in local mode, defaults to
--assetsstring optional beta- Folder of static assets to be served. Replaces Workers Sites. Visit assets for more information.
--sitestring optional deprecated, use `--assets`- Folder of static assets for Workers Sites.
--site-includestring[] optional deprecated- Array of
.gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
- Array of
--site-excludestring[] optional deprecated- Array of
.gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
- Array of
--upstream-protocol'http'|'https' (default: https) optional- Protocol to forward requests to host on.
--varkey:value\[] optional- Array of
key:valuepairs 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 thegit_hashandtestvariables available in your Worker'senv. - This flag is an alternative to defining
varsin your Wrangler configuration file. If defined in both places, this flag's values will be used.
- Array of
--definekey:value\[] optional- Array of
key:valuepairs to replace global identifiers in your code. - For example,
--define "GIT_HASH:'$(git rev-parse HEAD)'"will replace all uses ofGIT_HASHwith the actual value at build time. - This flag is an alternative to defining
definein your Wrangler configuration file. If defined in both places, this flag's values will be used.
- Array of
--tsconfigstring optional- Path to a custom
tsconfig.jsonfile.
- Path to a custom
--minifyboolean optional- Minify the Worker.
--persist-tostring optional- Specify directory to use for local persistence.
--remoteboolean (default: false) optional- Develop against remote resources and data stored on Cloudflare's network.
--test-scheduledboolean (default: false) optional- Exposes a
/__scheduledfetch route which will trigger a scheduled event (Cron Trigger) for testing during development. To simulate different cron patterns, acronquery parameter can be passed in:/__scheduled?cron=*+*+*+*+*or/cdn-cgi/handler/scheduled?cron=*+*+*+*+*.
- Exposes a
--log-level'debug'|'info'|'log'|'warn'|'error|'none' (default: log) optional- Specify Wrangler's logging level.
--show-interactive-dev-sessionboolean (default: true if the terminal supports interactivity) optional- Show the interactive dev session.
--aliasArray<string>- Specify modules to alias using module aliasing.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- 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 your Worker to Cloudflare.
wrangler deploy [<PATH>] [OPTIONS]-
PATHstring- A path specific what needs to be deployed, this can either be:
-
The path to an entry point for your Worker.
- Only required if your Wrangler configuration file does not include a
mainkey (for example,main = "index.js").
- Only required if your Wrangler configuration file does not include a
-
Or the path to an assets directory for the deployment of a static site.
- Visit assets for more information.
- This overrides the eventual
assetsconfiguration in your Wrangler configuration file. - This is equivalent to the
--assetsoption listed below. - Note: this option currently only works only in interactive mode (so not in CI systems).
-
- A path specific what needs to be deployed, this can either be:
-
--namestring optional- Name of the Worker.
-
--no-bundleboolean (default: false) optional- Skip Wrangler's build steps. Particularly useful when using custom builds. Refer to Bundling ↗ for more information.
-
--envstring optional- Perform on a specific environment.
-
--outdirstring optional- Path to directory where Wrangler will write the bundled Worker files.
-
--compatibility-datestring 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-flagstring[] optional- Flags to use for compatibility checks.
-
--latestboolean (default: true) optional- Use the latest version of the Workers runtime.
-
--assetsstring optional beta- Folder of static assets to be served. Replaces Workers Sites. Visit assets for more information.
-
--sitestring optional deprecated, use `--assets`- Folder of static assets for Workers Sites.
-
--site-includestring[] optional deprecated- Array of
.gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
- Array of
-
--site-excludestring[] optional deprecated- Array of
.gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
- Array of
-
--varkey:value\[] optional- Array of
key:valuepairs 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:123makes thegit_hashandtestvariables available in your Worker'senv. - This flag is an alternative to defining
varsin your Wrangler configuration file. If defined in both places, this flag's values will be used.
- Array of
-
--definekey:value\[] optional- Array of
key:valuepairs to replace global identifiers in your code. - For example,
--define GIT_HASH:$(git rev-parse HEAD)will replace all uses ofGIT_HASHwith the actual value at build time. - This flag is an alternative to defining
definein your Wrangler configuration file. If defined in both places, this flag's values will be used.
- Array of
-
--triggers,--schedule,--schedulesstring[] optional- Cron schedules to attach to the deployed Worker. Refer to Cron Trigger Examples.
-
--routes,--routestring[] optional- Routes where this Worker will be deployed.
- For example:
--route example.com/*.
-
--tsconfigstring optional- Path to a custom
tsconfig.jsonfile.
- Path to a custom
-
--minifyboolean optional- Minify the bundled Worker before deploying.
-
--dry-runboolean (default: false) optional- Compile a project without actually deploying to live servers. Combined with
--outdir, this is also useful for testing the output ofnpx 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.
- Compile a project without actually deploying to live servers. Combined with
-
--keep-varsboolean (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-varstotrue. - Secrets are never deleted by a deployment whether this flag is true or false.
-
--dispatch-namespacestring optional- Specify the Workers for Platforms dispatch namespace to upload this Worker to.
-
--metafilestring 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.jsoninside the directory specified by--outdir. This can be useful for understanding the bundle size.
- Specify a file to write the build metadata from esbuild to. If flag is used without a path string, this defaults to
-
--containers-rolloutimmediate | 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 inrollout_step_percentage. Note thatrollout_active_grace_period, if configured, still applies. - Defaults to
gradual, where the default rollout is 10% then 100% of instances.
- Specify the rollout strategy for Containers associated with the Worker. If set to
-
--strictboolean (default: false) optional- Turns on strict mode for the deployment command, meaning that the command will be more defensive and prevent deployments which could introduce potential issues. In particular, this mode prevents deployments if the deployment would potentially override remote settings in non-interactive environments.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Delete your Worker and all associated Cloudflare developer platform resources.
wrangler delete [<SCRIPT>] [OPTIONS]SCRIPTstring- The path to an entry point for your Worker. Only required if your Wrangler configuration file does not include a
mainkey (for example,main = "index.js").
- The path to an entry point for your Worker. Only required if your Wrangler configuration file does not include a
--namestring optional- Name of the Worker.
--envstring optional- Perform on a specific environment.
--dry-runboolean (default: false) optional- Do not actually delete the Worker. This is useful for testing the output of
wrangler delete.
- Do not actually delete the Worker. This is useful for testing the output of
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Manage Workers KV namespaces.
Create a new namespace
npx wrangler kv namespace create [NAMESPACE]pnpm wrangler kv namespace create [NAMESPACE]yarn wrangler kv namespace create [NAMESPACE]-
[NAMESPACE]string requiredThe name of the new namespace
-
--previewbooleanInteract with a preview namespace
-
--use-remotebooleanUse a remote binding when adding the newly created resource to your config
-
--update-configbooleanAutomatically update your config file with the newly added resource
-
--bindingstringThe binding name of this resource in your Worker
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Output a list of all KV namespaces associated with your account id
npx wrangler kv namespace listpnpm wrangler kv namespace listyarn wrangler kv namespace listGlobal flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a given namespace.
npx wrangler kv namespace deletepnpm wrangler kv namespace deleteyarn wrangler kv namespace delete-
--bindingstringThe binding name to the namespace to delete from
-
--namespace-idstringThe id of the namespace to delete
-
--previewbooleanInteract with a preview namespace
-
--skip-confirmationboolean alias: --y default: falseSkip confirmation
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Rename a KV namespace
npx wrangler kv namespace rename [OLD-NAME]pnpm wrangler kv namespace rename [OLD-NAME]yarn wrangler kv namespace rename [OLD-NAME]-
[OLD-NAME]stringThe current name (title) of the namespace to rename
-
--namespace-idstringThe id of the namespace to rename
-
--new-namestring requiredThe new name for the namespace
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Manage key-value pairs within a Workers KV namespace.
Write a single key/value pair to the given namespace
npx wrangler kv key put [KEY] [VALUE]pnpm wrangler kv key put [KEY] [VALUE]yarn wrangler kv key put [KEY] [VALUE]-
[KEY]string requiredThe key to write to
-
[VALUE]stringThe value to write
-
--bindingstringThe binding name to the namespace to write to
-
--namespace-idstringThe id of the namespace to write to
-
--previewbooleanInteract with a preview namespace
-
--ttlnumberTime for which the entries should be visible
-
--expirationnumberTime since the UNIX epoch after which the entry expires
-
--metadatastringArbitrary JSON that is associated with a key
-
--pathstringRead value from the file at a given path
-
--localbooleanInteract with local storage
-
--remotebooleanInteract with remote storage
-
--persist-tostringDirectory for local persistence
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Output a list of all keys in a given namespace
npx wrangler kv key listpnpm wrangler kv key listyarn wrangler kv key list-
--bindingstringThe binding name to the namespace to list
-
--namespace-idstringThe id of the namespace to list
-
--previewboolean default: falseInteract with a preview namespace
-
--prefixstringA prefix to filter listed keys
-
--localbooleanInteract with local storage
-
--remotebooleanInteract with remote storage
-
--persist-tostringDirectory for local persistence
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Read a single value by key from the given namespace
npx wrangler kv key get [KEY]pnpm wrangler kv key get [KEY]yarn wrangler kv key get [KEY]-
[KEY]string requiredThe key value to get.
-
--bindingstringThe binding name to the namespace to get from
-
--namespace-idstringThe id of the namespace to get from
-
--previewboolean default: falseInteract with a preview namespace
-
--textboolean default: falseDecode the returned value as a utf8 string
-
--localbooleanInteract with local storage
-
--remotebooleanInteract with remote storage
-
--persist-tostringDirectory for local persistence
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Remove a single key value pair from the given namespace
npx wrangler kv key delete [KEY]pnpm wrangler kv key delete [KEY]yarn wrangler kv key delete [KEY]-
[KEY]string requiredThe key value to delete.
-
--bindingstringThe binding name to the namespace to delete from
-
--namespace-idstringThe id of the namespace to delete from
-
--previewbooleanInteract with a preview namespace
-
--localbooleanInteract with local storage
-
--remotebooleanInteract with remote storage
-
--persist-tostringDirectory for local persistence
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Manage multiple key-value pairs within a Workers KV namespace in batches.
Gets multiple key-value pairs from a namespace
npx wrangler kv bulk get [FILENAME]pnpm wrangler kv bulk get [FILENAME]yarn wrangler kv bulk get [FILENAME]-
[FILENAME]string requiredThe file containing the keys to get
-
--bindingstringThe binding name to the namespace to get from
-
--namespace-idstringThe id of the namespace to get from
-
--previewbooleanInteract with a preview namespace
-
--localbooleanInteract with local storage
-
--remotebooleanInteract with remote storage
-
--persist-tostringDirectory for local persistence
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Upload multiple key-value pairs to a namespace
npx wrangler kv bulk put [FILENAME]pnpm wrangler kv bulk put [FILENAME]yarn wrangler kv bulk put [FILENAME]-
[FILENAME]string requiredThe file containing the key/value pairs to write
-
--bindingstringThe binding name to the namespace to write to
-
--namespace-idstringThe id of the namespace to write to
-
--previewbooleanInteract with a preview namespace
-
--ttlnumberTime for which the entries should be visible
-
--expirationnumberTime since the UNIX epoch after which the entry expires
-
--metadatastringArbitrary JSON that is associated with a key
-
--localbooleanInteract with local storage
-
--remotebooleanInteract with remote storage
-
--persist-tostringDirectory for local persistence
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete multiple key-value pairs from a namespace
npx wrangler kv bulk delete [FILENAME]pnpm wrangler kv bulk delete [FILENAME]yarn wrangler kv bulk delete [FILENAME]-
[FILENAME]string requiredThe file containing the keys to delete
-
--bindingstringThe binding name to the namespace to delete from
-
--namespace-idstringThe id of the namespace to delete from
-
--previewbooleanInteract with a preview namespace
-
--forceboolean alias: --fDo not ask for confirmation before deleting
-
--localbooleanInteract with local storage
-
--remotebooleanInteract with remote storage
-
--persist-tostringDirectory for local persistence
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Interact with buckets in an R2 store.
Create a new R2 bucket.
wrangler r2 bucket create <NAME>NAMEstring required- The name of the new R2 bucket.
--locationstring 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.
--jurisdictionstring optional- The jurisdiction where the R2 bucket is created. Refer to jurisdictional restrictions.
Get information about an R2 bucket, including the bucket size and number of objects.
wrangler r2 bucket info <NAME>NAMEstring required- The name of the R2 bucket to get information about.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--jsonboolean optional- Return output as clean JSON.
- Default: false
Delete an R2 bucket.
wrangler r2 bucket delete <NAME>NAMEstring required- The name of the R2 bucket to delete.
List R2 bucket in the current account.
wrangler r2 bucket listEnable R2 Data Catalog on an R2 bucket.
wrangler r2 bucket catalog enable <NAME> [OPTIONS]NAMEstring required- The name of the bucket to enable R2 Data Catalog for.
Disable R2 Data Catalog on an R2 bucket.
wrangler r2 bucket catalog disable <NAME> [OPTIONS]NAMEstring required- The name of the bucket to disable R2 Data Catalog for.
Get the status of R2 Data Catalog for an R2 bucket, including catalog URI and warehouse name.
wrangler r2 bucket catalog get <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket whose data catalog status to retrieve.
Enable compaction on a R2 Data Catalog or a specific table.
wrangler r2 bucket catalog compaction enable <BUCKET> [NAMESPACE] [TABLE] [OPTIONS]BUCKETstring required- The name of the bucket to enable R2 Data Catalog compaction for.
NAMESPACEstring optional- The namespace containing the table (for table-level compaction). Must be provided together with
TABLE.
- The namespace containing the table (for table-level compaction). Must be provided together with
TABLEstring optional- The name of the table (for table-level compaction). Must be provided together with
NAMESPACE.
- The name of the table (for table-level compaction). Must be provided together with
--tokenstring optional- The R2 API token with R2 Data Catalog edit permissions. Required for catalog-level compaction only.
--target-sizenumber optional- The target file size (in MB) compaction will attempt to generate. Default: 128. Allowed values: 64, 128, 256, 512.
Examples:
# Enable catalog-level compaction (requires token)npx wrangler r2 bucket catalog compaction enable my-bucket --token <TOKEN>
# Enable table-level compactionnpx wrangler r2 bucket catalog compaction enable my-bucket my-namespace my-table --target-size 256Disable compaction on a R2 Data Catalog or a specific table.
wrangler r2 bucket catalog compaction disable <BUCKET> [NAMESPACE] [TABLE] [OPTIONS]BUCKETstring required- The name of the bucket to disable R2 Data Catalog compaction for.
NAMESPACEstring optional- The namespace containing the table (for table-level compaction). Must be provided together with
TABLE.
- The namespace containing the table (for table-level compaction). Must be provided together with
TABLEstring optional- The name of the table (for table-level compaction). Must be provided together with
NAMESPACE.
- The name of the table (for table-level compaction). Must be provided together with
Examples:
# Disable catalog-level compactionnpx wrangler r2 bucket catalog compaction disable my-bucket
# Disable table-level compactionnpx wrangler r2 bucket catalog compaction disable my-bucket my-namespace my-tableSet the CORS configuration for an R2 bucket from a JSON file.
wrangler r2 bucket cors set <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to set the CORS configuration for.
--filestring required- Path to the JSON file containing CORS configuration (file must be in format of request body of put bucket CORS policy API).
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when setting CORS configuration.
Clear the CORS configuration for an R2 bucket.
wrangler r2 bucket cors delete <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to delete the CORS configuration for.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when clearing the CORS configuration.
List the CORS configuration rules for an R2 bucket.
wrangler r2 bucket cors list <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to list the CORS rules for.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
Enable public access via the r2.dev URL for an R2 bucket.
wrangler r2 bucket dev-url enable <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to enable public access via its r2.dev URL.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when enabling public access via r2.dev URL.
Disable public access via the r2.dev URL for an R2 bucket.
wrangler r2 bucket dev-url disable <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to disable public access via its r2.dev URL.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when disabling public access via r2.dev URL.
Get the r2.dev URL and status for an R2 bucket.
wrangler r2 bucket dev-url get <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket whose r2.dev URL status to retrieve.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
Connect a custom domain to an R2 bucket.
wrangler r2 bucket domain add <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to connect a custom domain to.
--domainstring required- The custom domain to connect to the R2 bucket.
--zone-idstring 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).
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when adding the custom domain.
Remove a custom domain from an R2 bucket.
wrangler r2 bucket domain remove <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to remove the custom domain from.
--domainstring required- The custom domain to remove from the R2 bucket.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when removing the custom domain.
Update settings for a custom domain connected to an R2 bucket.
wrangler r2 bucket domain update <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket associated with the custom domain to update.
--domainstring 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.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
Get custom domain connected to an R2 bucket.
wrangler r2 bucket domain get <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket whose custom domain to retrieve.
--domainstring required- The custom domain to get information for.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
List custom domains for an R2 bucket.
wrangler r2 bucket domain list <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket whose connected custom domains will be listed.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
Add an object lifecycle rule to an R2 bucket.
wrangler r2 bucket lifecycle add <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to add a lifecycle rule to.
--namestring optional- A unique name for the lifecycle rule, used to identify and manage it. For example:
delete-logs-180-days.
- A unique name for the lifecycle rule, used to identify and manage it. For example:
--prefixstring optional- Prefix condition for the lifecycle rule (leave empty for all prefixes).
--expire-daysnumber optional- Sets the lifecycle rule action to expire objects after this number of days. Note you can provide only one of
--expire-daysor--expire-date.
- Sets the lifecycle rule action to expire objects after this number of days. Note you can provide only one of
--expire-datestring optional- Sets the lifecycle rule action to expire objects after this date (YYYY-MM-DD). Note you can provide only one of
--expire-daysor--expire-date.
- Sets the lifecycle rule action to expire objects after this date (YYYY-MM-DD). Note you can provide only one of
--ia-transition-daysnumber 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-daysor--ia-transition-date.
- 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-datestring 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-daysor--ia-transition-date.
- 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
--abort-multipart-daysnumber optional- Sets the lifecycle rule action to abort incomplete multipart uploads after this number of days.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when adding the lifecycle rule.
Remove an object lifecycle rule from an R2 bucket.
wrangler r2 bucket lifecycle remove <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to remove a lifecycle rule from.
--namestring required- The unique name of the lifecycle rule to remove.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
List object lifecycle rules for an R2 bucket.
wrangler r2 bucket lifecycle list <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to list lifecycle rules for.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
Set the object lifecycle configuration for an R2 bucket from a JSON file.
wrangler r2 bucket lifecycle set <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to set lifecycle configuration for.
--filestring required- Path to the JSON file containing lifecycle configuration (file must be in format of request body of put object lifecycle configuration API).
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when setting object lifecycle configuration.
Add a bucket lock rule to an R2 bucket.
wrangler r2 bucket lock add <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to add a bucket lock rule to.
--namestring optional- A unique name for the bucket lock rule, used to identify and manage it. For example:
retain-logs-180-days.
- A unique name for the bucket lock rule, used to identify and manage it. For example:
--prefixstring optional- Prefix condition for the bucket lock rule (leave empty for all prefixes).
--retention-daysnumber optional- Sets the number of days to retain objects for. Note you can provide only one of
--retention-days,--retention-date, or--retention-indefinite.
- Sets the number of days to retain objects for. Note you can provide only one of
--retention-datestring optional- Sets the number of days to retain objects for. Note you can provide only one of
--retention-days,--retention-date, or--retention-indefinite.
- Sets the number of days to retain objects for. Note you can provide only one of
--retention-indefinitestring 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.
- Sets the retention period to indefinite — meaning the lock will remain in place until explicitly removed. Note you can provide only one of
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when adding the bucket lock rule.
Remove a bucket lock rule from an R2 bucket.
wrangler r2 bucket lock remove <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to remove a bucket lock rule from.
--namestring required- The unique name of the bucket lock rule to remove.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
List bucket lock rules for an R2 bucket.
wrangler r2 bucket lock list <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to list bucket locks rules for.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
Set the bucket lock configuration for an R2 bucket from a JSON file.
wrangler r2 bucket lock set <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to set bucket lock configuration for.
--filestring required- Path to the JSON file containing bucket lock configuration (file must be in format of request body of put bucket lock configuration API).
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
--forceboolean optional- Skip confirmation when setting bucket lock configuration.
Create an event notification rule for an R2 bucket.
wrangler r2 bucket notification create <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to create an event notification rule for.
--event-type'object-create'|'object-delete'[] required- The type of event(s) that will trigger event notifications.
--queuestring required- The name of the queue that will receive event notification messages.
--prefixstring optional- The prefix that an object must match to emit event notifications (note: regular expressions are not supported).
--suffixstring optional- The suffix that an object must match to emit event notifications (note: regular expressions are not supported).
--descriptionstring optional- A description that can be used to identify the event notification rule after creation.
Remove an event notification rule from a bucket's event notification configuration.
wrangler r2 bucket notification delete <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to delete an event notification rule for.
--queuestring required- The name of the queue that corresponds to the event notification rule. If no
ruleis provided, all event notification rules associated with the queue will be deleted.
- The name of the queue that corresponds to the event notification rule. If no
--rulestring optional- The ID of the event notification rule to delete.
List the event notification rules for a bucket.
wrangler r2 bucket notification list <NAME>NAMEstring required- The name of the R2 bucket to get event notification rules for.
Enable Sippy incremental migration for a bucket.
wrangler r2 bucket sippy enable <NAME> [OPTIONS]NAMEstring required- The name of the R2 bucket to enable Sippy.
--provider'AWS'|'GCS' required- The provider of your source object storage bucket.
--bucketstring required- The name of your source object storage bucket.
--r2-key-idstring required- Your R2 Access Key ID. Requires read and write access.
--r2-secret-access-keystring required- Your R2 Secret Access Key. Requires read and write access.
--jurisdictionstring optional- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to jurisdictional restrictions.
- AWS S3 provider-specific options:
--key-idstring optional- Your AWS Access Key ID. Requires read and list access.
--secret-access-keystring optional- Your AWS Secret Access Key. Requires read and list access.
--regionstring optional- The AWS region where your S3 bucket is located. For example:
us-west-2.
- The AWS region where your S3 bucket is located. For example:
- Google Cloud Storage provider-specific options:
--service-account-key-filestring optional- The path to your Google Cloud service account key JSON file. This will read the service account key file and populate
client_emailandprivate_keyoptions. Requires read and list access.
- The path to your Google Cloud service account key JSON file. This will read the service account key file and populate
--client-emailstring optional- The client email for your Google Cloud service account key. Requires read and list access.
--private-keystring optional- The private key for your Google Cloud service account key. Requires read and list access.
- Note that you must provide either
service-account-key-fileorclient_emailandprivate_keyfor this command to run successfully.
Disable Sippy incremental migration for a bucket.
wrangler r2 bucket sippy disable <NAME>NAMEstring required- The name of the R2 bucket to disable Sippy.
Get the status of Sippy incremental migration for a bucket.
wrangler r2 bucket sippy get <NAME>NAMEstring required- The name of the R2 bucket to get the status of Sippy.
Interact with R2 objects.
Fetch an object from an R2 bucket.
wrangler r2 object get <OBJECT_PATH> [OPTIONS]OBJECT_PATHstring required- The source object path in the form of
{bucket}/{key}.
- The source object path in the form of
--localboolean (default: true) optional- Interact with locally persisted data.
--remoteboolean (default: false) optional- Interact with remote storage.
--persist-tostring optional- Specify directory for locally persisted data.
Create an object in an R2 bucket.
wrangler r2 object put <OBJECT_PATH> [OPTIONS]OBJECT_PATHstring required- The destination object path in the form of
{bucket}/{key}.
- The destination object path in the form of
--filestring optional- The path of the file to upload. Note you must provide either
--fileor--pipe.
- The path of the file to upload. Note you must provide either
--pipeboolean optional- Enables the file to be piped in, rather than specified with the
--fileoption. Note you must provide either--fileor--pipe.
- Enables the file to be piped in, rather than specified with the
--content-typestring optional- A standard MIME type describing the format of the object data.
--content-dispositionstring optional- Specifies presentational information for the object.
--content-encodingstring 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-Typeheader field.
- 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-languagestring optional- The language the content is in.
--cache-controlstring optional- Specifies caching behavior along the request/reply chain.
--expiresstring optional- The date and time at which the object is no longer cacheable.
--localboolean (default: true) optional- Interact with locally persisted data.
--remoteboolean (default: false) optional- Interact with remote storage.
--persist-tostring optional- Specify directory for locally persisted data.
Delete an object in an R2 bucket.
wrangler r2 object delete <OBJECT_PATH> [OPTIONS]OBJECT_PATHstring required- The destination object path in the form of
{bucket}/{key}.
- The destination object path in the form of
--localboolean (default: true) optional- Interact with locally persisted data.
--remoteboolean (default: false) optional- Interact with remote storage.
--persist-tostring optional- Specify directory for locally persisted data.
Query a table in R2 Data Catalog using R2 SQL
wrangler r2 sql query <warehouse> <query>warehousestring required- Your R2 Data Catalog warehouse name.
querystring required- The SQL query to execute. Refer to the SQL reference.
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.
Create or update a secret variable for a Worker
npx wrangler secret put [KEY]pnpm wrangler secret put [KEY]yarn wrangler secret put [KEY]-
[KEY]string requiredThe variable name to be accessible in the Worker
-
--namestringName of the Worker
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
When running this command, you will be prompted to input the secret's value:
npx wrangler secret put FOO? Enter a secret value: > ***🌀 Creating the secret for script worker-app✨ Success! Uploaded secret FOOThe put command can also receive piped input. For example:
echo "-----BEGIN PRIVATE KEY-----\nM...==\n-----END PRIVATE KEY-----\n" | wrangler secret put PRIVATE_KEYDelete a secret variable from a Worker
npx wrangler secret delete [KEY]pnpm wrangler secret delete [KEY]yarn wrangler secret delete [KEY]-
[KEY]string requiredThe variable name to be accessible in the Worker
-
--namestringName of the Worker
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List all secrets for a Worker
npx wrangler secret listpnpm wrangler secret listyarn wrangler secret list-
--namestringName of the Worker
-
--format"json" | "pretty" default: jsonThe format to print the secrets in
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of listing the secrets for the current Worker.
npx wrangler secret list[ { "name": "FOO", "type": "secret_text" }]Bulk upload secrets for a Worker
npx wrangler secret bulk [FILE]pnpm wrangler secret bulk [FILE]yarn wrangler secret bulk [FILE]-
[FILE]stringThe file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE
-
--namestringName of the Worker
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
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"}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 uploadWith the release of Secrets Store in open beta, you can use the following commands to manage your account secrets.
Create a secret within a store.
wrangler secrets-store secret create <STORE_ID> [OPTIONS]STORE_IDstring required- The secret store public ID. You can find it and copy from the Secrets Store tab ↗ on the dashboard.
--namestring required- A descriptive name for the account-level secret. Cannot contain spaces.
--valuestring test only- Value of the secret.
--scopesstring required- Which services will have access to the account-level secret. Currently, only
workersis available.
- Which services will have access to the account-level secret. Currently, only
--commentstring optional- Additional information about the account-level secret.
--remoteboolean (default: false) optional- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
--remoteto your commands.
- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
The following is an example of using the create command to create an account-level secret.
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 a secret within a store.
wrangler secrets-store secret update <STORE_ID> [OPTIONS]STORE_IDstring required- The ID of the secrets store that contains the secret you are updating.
--secret-idstring required- The ID of the secret to update.
--valuestring test only- Updated value of the secret.
--scopesstring required- Which services will have access to the account-level secret. Currently, only
workersis available.
- Which services will have access to the account-level secret. Currently, only
--commentstring optional- Updated comment for the account-level secret.
--remoteboolean (default: false) optional- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
--remoteto your commands.
- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
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_IDstring required- The ID of the secrets store that contains the secret you are duplicating.
--secret-idstring required- The ID of the secret you are duplicating.
--namestring required- A name for the new secret. Cannot contain spaces.
--scopesstring required- Which services will have access to the new account-level secret. Currently, only
workersis available.
- Which services will have access to the new account-level secret. Currently, only
--commentstring optional- Additional information about the new account-level secret.
--remoteboolean (default: false) optional- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
--remoteto your commands.
- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
Get information on a secret within a store.
wrangler secrets-store secret get <STORE_ID> [OPTIONS]STORE_IDstring required- The ID of the secrets store that contains the secret you want to get.
--secret-idstring required- The ID of the secret you want to get.
--remoteboolean (default: false) optional- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
--remoteto your commands.
- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
The following is an example with the expected output:
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 a secret within a store.
wrangler secrets-store secret delete <STORE_ID> [OPTIONS]STORE_IDstring required- The ID of the secrets store that contains the secret you are deleting.
--secret-idstring required- The ID of the secret you are deleting.
--remoteboolean (default: false) optional- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
--remoteto your commands.
- Execute the command against the remote Secrets Store. To interact with account-level secrets in production, make sure to append
List secrets within a store.
wrangler secrets-store secret list <STORE_ID>STORE_IDstring required- The secret store public ID. You can find it and copy from the Secrets Store tab ↗ on the dashboard.
Use the following commands to manage your store.
Create a store within Secrets Store.
wrangler secrets-store store create <name>namestring required- A descriptive name for the account-level secret. Cannot contain spaces.
--remoteboolean (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.
npx wrangler secrets-store store create default --remote🔐 Creating store... (Name: default)✅ Created store! (Name: default, ID: 2e2a82d317134506b58defbe16982d54)Delete a store within Secrets Store.
wrangler secrets-store store delete <STORE_ID>STORE_IDstring required- The secret store public ID. You can find it and copy from the Secrets Store tab ↗ on the dashboard.
--remoteboolean (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.
npx wrangler secrets-store store delete d2dafaeac9434de2b6d08b292ce08211 --remote🔐 Deleting store... (Name: d2dafaeac9434de2b6d08b292ce08211)✅ Deleted store! (ID: d2dafaeac9434de2b6d08b292ce08211)List the stores within an account.
wrangler secrets-store store list--remoteboolean (default: false) required- Execute the command against the remote Secrets Store.
The following is an example of using the list command to list stores.
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 │└─────────┴──────────────────────────────────┴──────────────────────────────────┴──────────────────────┴──────────────────────┘Manage and configure Workflows.
List Workflows associated to account
npx wrangler workflows listpnpm wrangler workflows listyarn wrangler workflows list-
--pagenumber default: 1Show a sepecific page from the listing, can configure page size using "per-page"
-
--per-pagenumberConfigure the maximum number of workflows to show per page
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Describe Workflow resource
npx wrangler workflows describe [NAME]pnpm wrangler workflows describe [NAME]yarn wrangler workflows describe [NAME]-
[NAME]string requiredName of the workflow
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete workflow - when deleting a workflow, it will also delete it's own instances
npx wrangler workflows delete [NAME]pnpm wrangler workflows delete [NAME]yarn wrangler workflows delete [NAME]-
[NAME]string requiredName of the workflow
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Trigger a workflow, creating a new instance. Can optionally take a JSON string to pass a parameter into the workflow instance
npx wrangler workflows trigger [NAME] [PARAMS]pnpm wrangler workflows trigger [NAME] [PARAMS]yarn wrangler workflows trigger [NAME] [PARAMS]-
[NAME]string requiredName of the workflow
-
[PARAMS]string default:Params for the workflow instance, encoded as a JSON string
-
--idstringCustom instance ID, if not provided it will default to a random UUIDv4
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Instance related commands (list, describe, terminate, pause, resume)
npx wrangler workflows instances list [NAME]pnpm wrangler workflows instances list [NAME]yarn wrangler workflows instances list [NAME]-
[NAME]string requiredName of the workflow
-
--reverseboolean default: falseReverse order of the instances table
-
--statusstringFilters list by instance status (can be one of: queued, running, paused, errored, terminated, complete)
-
--pagenumber default: 1Show a sepecific page from the listing, can configure page size using "per-page"
-
--per-pagenumberConfigure the maximum number of instances to show per page
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Describe a workflow instance - see its logs, retries and errors
npx wrangler workflows instances describe [NAME] [ID]pnpm wrangler workflows instances describe [NAME] [ID]yarn wrangler workflows instances describe [NAME] [ID]-
[NAME]string requiredName of the workflow
-
[ID]string default: latestID of the instance - instead of an UUID you can type 'latest' to get the latest instance and describe it
-
--step-outputboolean default: trueDon't output the step output since it might clutter the terminal
-
--truncate-output-limitnumber default: 5000Truncate step output after x characters
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Terminate a workflow instance
npx wrangler workflows instances terminate [NAME] [ID]pnpm wrangler workflows instances terminate [NAME] [ID]yarn wrangler workflows instances terminate [NAME] [ID]-
[NAME]string requiredName of the workflow
-
[ID]string requiredID of the instance - instead of an UUID you can type 'latest' to get the latest instance and describe it
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Restart a workflow instance
npx wrangler workflows instances restart [NAME] [ID]pnpm wrangler workflows instances restart [NAME] [ID]yarn wrangler workflows instances restart [NAME] [ID]-
[NAME]string requiredName of the workflow
-
[ID]string requiredID of the instance - instead of an UUID you can type 'latest' to get the latest instance and describe it
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Pause a workflow instance
npx wrangler workflows instances pause [NAME] [ID]pnpm wrangler workflows instances pause [NAME] [ID]yarn wrangler workflows instances pause [NAME] [ID]-
[NAME]string requiredName of the workflow
-
[ID]string requiredID of the instance - instead of an UUID you can type 'latest' to get the latest instance and pause it
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Resume a workflow instance
npx wrangler workflows instances resume [NAME] [ID]pnpm wrangler workflows instances resume [NAME] [ID]yarn wrangler workflows instances resume [NAME] [ID]-
[NAME]string requiredName of the workflow
-
[ID]string requiredID of the instance - instead of an UUID you can type 'latest' to get the latest instance and resume it
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
🦚 Start a log tailing session for a Worker
npx wrangler tail [WORKER]pnpm wrangler tail [WORKER]yarn wrangler tail [WORKER]-
[WORKER]stringName or route of the worker to tail
-
--format"json" | "pretty"The format of log entries
-
--status"ok" | "error" | "canceled"Filter by invocation status
-
--headerstringFilter by HTTP header
-
--methodstringFilter by HTTP method
-
--sampling-ratenumberAdds a percentage of requests to log sampling rate
-
--searchstringFilter by a text match in console.log messages
-
--ipstringFilter by the IP address the request originates from. Use "self" to filter for your own IP
-
--version-idstringFilter by Worker version
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
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 ↗.
Configure Cloudflare Pages.
Develop your full-stack Pages application locally.
wrangler pages dev [<DIRECTORY>] [OPTIONS]DIRECTORYstring optional- The directory of static assets to serve.
--localboolean optional (default: true)- Run on your local machine.
--ipstring optional- IP address to listen on, defaults to
localhost.
- IP address to listen on, defaults to
--portnumber optional (default: 8788)- The port to listen on (serve from).
--config,-cstring[] 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.
--bindingstring[] optional- Bind an environment variable or secret (for example,
--binding <VARIABLE_NAME>=<VALUE>).
- Bind an environment variable or secret (for example,
--kvstring[] optional- Binding name of KV namespace to bind (for example,
--kv <BINDING_NAME>).
- Binding name of KV namespace to bind (for example,
--r2string[] optional- Binding name of R2 bucket to bind (for example,
--r2 <BINDING_NAME>).
- Binding name of R2 bucket to bind (for example,
--d1string[] optional- Binding name of D1 database to bind (for example,
--d1 <BINDING_NAME>).
- Binding name of D1 database to bind (for example,
--dostring[] optional- Binding name of Durable Object to bind (for example,
--do <BINDING_NAME>=<CLASS>).
- Binding name of Durable Object to bind (for example,
--live-reloadboolean optional (default: false)- Auto reload HTML pages when change is detected.
--compatibility-flagstring[] optional- Runtime compatibility flags to apply.
--compatibility-datestring optional- Runtime compatibility date to apply.
--show-interactive-dev-sessionboolean optional (default: true if the terminal supports interactivity)- Show the interactive dev session.
--https-key-pathstring optional- Path to a custom certificate key.
--https-cert-pathstring optional- Path to a custom certificate.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Download your Pages project config as a Wrangler configuration file.
wrangler pages download config <PROJECT_NAME>The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
List your Pages projects.
wrangler pages project listThe following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Create a new Cloudflare Pages project.
wrangler pages project create <PROJECT_NAME> [OPTIONS]PROJECT_NAMEstring required- The name of your Pages project.
--production-branchstring optional- The name of the production branch of your project.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Delete a Cloudflare Pages project.
wrangler pages project delete <PROJECT_NAME> [OPTIONS]PROJECT_NAMEstring required- The name of the Pages project to delete.
--yesboolean optional- Answer
"yes"to confirmation prompt.
- Answer
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
List deployments in your Cloudflare Pages project.
wrangler pages deployment list [--project-name <PROJECT_NAME>]--project-namestring optional- The name of the project you would like to list deployments for.
--environment'production'|'preview' optional- Environment type to list deployments for.
--jsonboolean optional- Whether to output the list in JSON format.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Start a session to livestream logs from your deployed Pages Functions.
wrangler pages deployment tail [<DEPLOYMENT>] [OPTIONS]DEPLOYMENTstring optional- ID or URL of the deployment to tail. Specify by environment if deployment ID is unknown.
--project-namestring 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.
--headerstring optional- Filter by HTTP header.
--methodstring optional- Filter by HTTP method.
--sampling-ratenumber optional- Add a percentage of requests to log sampling rate.
--searchstring optional- Filter by a text match in
console.logmessages.
- Filter by a text match in
--ip(string|'self')\[] optional- Filter by the IP address the request originates from. Use
"self"to show only messages from your own IP.
- Filter by the IP address the request originates from. Use
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- 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 a directory of static assets as a Pages deployment.
wrangler pages deploy <BUILD_OUTPUT_DIRECTORY> [OPTIONS]BUILD_OUTPUT_DIRECTORYstring optional- The directory of static files to upload. As of Wrangler 3.45.0, this is only required when your Pages project does not have a Wrangler file. Refer to the Pages Functions configuration guide for more information.
--project-namestring optional- The name of the project you want to deploy to.
--branchstring optional- The name of the branch you want to deploy to.
--commit-hashstring optional- The SHA to attach to this deployment.
--commit-messagestring optional- The commit message to attach to this deployment.
--commit-dirtyboolean optional- Whether or not the workspace should be considered dirty for this deployment.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Create or update a secret for a Pages project.
wrangler pages secret put <KEY> [OPTIONS]KEYstring required- The variable name for this secret to be accessed in the Pages project.
--project-namestring optional- The name of your Pages project.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Delete a secret from a Pages project.
wrangler pages secret delete <KEY> [OPTIONS]KEYstring required- The variable name for this secret to be accessed in the Pages project.
--project-namestring optional- The name of your Pages project.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
List the names of all the secrets for a Pages project.
wrangler pages secret list [OPTIONS]--project-namestring optional- The name of your Pages project.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Upload multiple secrets for a Pages project at once.
wrangler pages secret bulk [<FILENAME>] [OPTIONS]FILENAMEstring 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
.envfile containing key-value pairs to upload as secrets, in the formSECRET_NAME=secret value. - If omitted, Wrangler expects to receive input from
stdinrather than a file.
--project-namestring optional- The name of your Pages project.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Compile a folder of Pages Functions into a single Worker.
wrangler pages functions build [<DIRECTORY>] [OPTIONS]DIRECTORYstring optional (default: `functions`)- The directory of Pages Functions.
--outdirstring optional- Output directory for the bundled Worker.
--fallback-servicestring optional (default: `ASSETS`)- The service to fallback to at the end of the
nextchain. Setting to''will fallback to the globalfetch.
- The service to fallback to at the end of the
--compatibility-datestring optional- Date to use for compatibility checks.
--compatibility-flagsstring[] optional- Flags to use for compatibility checks.
--metafilestring 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.jsoninside the directory specified by--outdir. This can be useful for understanding the bundle size.
- Specify a file to write the build metadata from esbuild to. If flag is used without a path string, this defaults to
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Manage your Pipelines.
Interactive setup for a complete pipeline
npx wrangler pipelines setuppnpm wrangler pipelines setupyarn wrangler pipelines setup-
--namestringPipeline name
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create a new pipeline
npx wrangler pipelines create [PIPELINE]pnpm wrangler pipelines create [PIPELINE]yarn wrangler pipelines create [PIPELINE]-
[PIPELINE]string requiredThe name of the pipeline to create
-
--sqlstringInline SQL query for the pipeline
-
--sql-filestringPath to file containing SQL query for the pipeline
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List all pipelines
npx wrangler pipelines listpnpm wrangler pipelines listyarn wrangler pipelines list-
--pagenumber default: 1Page number for pagination
-
--per-pagenumber default: 20Number of pipelines per page
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get details about a specific pipeline
npx wrangler pipelines get [PIPELINE]pnpm wrangler pipelines get [PIPELINE]yarn wrangler pipelines get [PIPELINE]-
[PIPELINE]string requiredThe ID of the pipeline to retrieve
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Update a pipeline configuration (legacy pipelines only)
npx wrangler pipelines update [PIPELINE]pnpm wrangler pipelines update [PIPELINE]yarn wrangler pipelines update [PIPELINE]-
[PIPELINE]string requiredThe name of the legacy pipeline to update
-
--sourcearraySpace separated list of allowed sources. Options are 'http' or 'worker'
-
--require-http-authbooleanRequire Cloudflare API Token for HTTPS endpoint authentication
-
--cors-originsarrayCORS origin allowlist for HTTP endpoint (use * for any origin). Defaults to an empty array
-
--batch-max-mbnumberMaximum batch size in megabytes before flushing. Defaults to 100 MB if unset. Minimum: 1, Maximum: 100
-
--batch-max-rowsnumberMaximum number of rows per batch before flushing. Defaults to 10,000,000 if unset. Minimum: 100, Maximum: 10,000,000
-
--batch-max-secondsnumberMaximum age of batch in seconds before flushing. Defaults to 300 if unset. Minimum: 1, Maximum: 300
-
--r2-bucketstringDestination R2 bucket name
-
--r2-access-key-idstringR2 service Access Key ID for authentication. Leave empty for OAuth confirmation.
-
--r2-secret-access-keystringR2 service Secret Access Key for authentication. Leave empty for OAuth confirmation.
-
--r2-prefixstringPrefix for storing files in the destination bucket. Default is no prefix
-
--compressionstringCompression format for output files
-
--shard-countnumberNumber of shards for the pipeline. More shards handle higher request volume; fewer shards produce larger output files. Defaults to 2 if unset. Minimum: 1, Maximum: 15
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a pipeline
npx wrangler pipelines delete [PIPELINE]pnpm wrangler pipelines delete [PIPELINE]yarn wrangler pipelines delete [PIPELINE]-
[PIPELINE]string requiredThe ID or name of the pipeline to delete
-
--forceboolean alias: --y default: falseSkip confirmation
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create a new stream
npx wrangler pipelines streams create [STREAM]pnpm wrangler pipelines streams create [STREAM]yarn wrangler pipelines streams create [STREAM]-
[STREAM]string requiredThe name of the stream to create
-
--schema-filestringPath to JSON file containing stream schema
-
--http-enabledboolean default: trueEnable HTTP endpoint
-
--http-authboolean default: trueRequire authentication for HTTP endpoint
-
--cors-originstringCORS origin
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List all streams
npx wrangler pipelines streams listpnpm wrangler pipelines streams listyarn wrangler pipelines streams list-
--pagenumber default: 1Page number for pagination
-
--per-pagenumber default: 20Number of streams per page
-
--pipeline-idstringFilter streams by pipeline ID
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get details about a specific stream
npx wrangler pipelines streams get [STREAM]pnpm wrangler pipelines streams get [STREAM]yarn wrangler pipelines streams get [STREAM]-
[STREAM]string requiredThe ID of the stream to retrieve
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a stream
npx wrangler pipelines streams delete [STREAM]pnpm wrangler pipelines streams delete [STREAM]yarn wrangler pipelines streams delete [STREAM]-
[STREAM]string requiredThe ID of the stream to delete
-
--forceboolean alias: --y default: falseSkip confirmation
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create a new sink
npx wrangler pipelines sinks create [SINK]pnpm wrangler pipelines sinks create [SINK]yarn wrangler pipelines sinks create [SINK]-
[SINK]string requiredThe name of the sink to create
-
--typestring requiredThe type of sink to create
-
--bucketstring requiredR2 bucket name
-
--formatstring default: parquetOutput format
-
--compressionstring default: zstdCompression method (parquet only)
-
--target-row-group-sizestringTarget row group size for parquet format
-
--pathstringThe base prefix in your bucket where data will be written
-
--partitioningstringTime partition pattern (r2 sinks only)
-
--roll-sizenumberRoll file size in MB
-
--roll-intervalnumber default: 300Roll file interval in seconds
-
--access-key-idstringR2 access key ID (leave empty for R2 credentials to be automatically created)
-
--secret-access-keystringR2 secret access key (leave empty for R2 credentials to be automatically created)
-
--namespacestringData catalog namespace (required for r2-data-catalog)
-
--tablestringTable name within namespace (required for r2-data-catalog)
-
--catalog-tokenstringAuthentication token for data catalog (required for r2-data-catalog)
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List all sinks
npx wrangler pipelines sinks listpnpm wrangler pipelines sinks listyarn wrangler pipelines sinks list-
--pagenumber default: 1Page number for pagination
-
--per-pagenumber default: 20Number of sinks per page
-
--pipeline-idstringFilter sinks by pipeline ID
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get details about a specific sink
npx wrangler pipelines sinks get [SINK]pnpm wrangler pipelines sinks get [SINK]yarn wrangler pipelines sinks get [SINK]-
[SINK]string requiredThe ID of the sink to retrieve
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a sink
npx wrangler pipelines sinks delete [SINK]pnpm wrangler pipelines sinks delete [SINK]yarn wrangler pipelines sinks delete [SINK]-
[SINK]string requiredThe ID of the sink to delete
-
--forceboolean alias: --y default: falseSkip confirmation
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Manage your Workers Queues configurations.
List queues
npx wrangler queues listpnpm wrangler queues listyarn wrangler queues list-
--pagenumberPage number for pagination
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create a queue
npx wrangler queues create [NAME]pnpm wrangler queues create [NAME]yarn wrangler queues create [NAME]-
[NAME]string requiredThe name of the queue
-
--delivery-delay-secsnumber default: 0How long a published message should be delayed for, in seconds. Must be between 0 and 42300
-
--message-retention-period-secsnumber default: 345600How long to retain a message in the queue, in seconds. Must be between 60 and 1209600
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Update a queue
npx wrangler queues update [NAME]pnpm wrangler queues update [NAME]yarn wrangler queues update [NAME]-
[NAME]string requiredThe name of the queue
-
--delivery-delay-secsnumberHow long a published message should be delayed for, in seconds. Must be between 0 and 42300
-
--message-retention-period-secsnumberHow long to retain a message in the queue, in seconds. Must be between 60 and 1209600
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a queue
npx wrangler queues delete [NAME]pnpm wrangler queues delete [NAME]yarn wrangler queues delete [NAME]-
[NAME]string requiredThe name of the queue
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get queue information
npx wrangler queues info [NAME]pnpm wrangler queues info [NAME]yarn wrangler queues info [NAME]-
[NAME]string requiredThe name of the queue
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Add a Queue Worker Consumer
npx wrangler queues consumer add [QUEUE-NAME] [SCRIPT-NAME]pnpm wrangler queues consumer add [QUEUE-NAME] [SCRIPT-NAME]yarn wrangler queues consumer add [QUEUE-NAME] [SCRIPT-NAME]-
[QUEUE-NAME]string requiredName of the queue to configure
-
[SCRIPT-NAME]string requiredName of the consumer script
-
--batch-sizenumberMaximum number of messages per batch
-
--batch-timeoutnumberMaximum number of seconds to wait to fill a batch with messages
-
--message-retriesnumberMaximum number of retries for each message
-
--dead-letter-queuestringQueue to send messages that failed to be consumed
-
--max-concurrencynumberThe maximum number of concurrent consumer Worker invocations. Must be a positive integer
-
--retry-delay-secsnumberThe number of seconds to wait before retrying a message
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Remove a Queue Worker Consumer
npx wrangler queues consumer remove [QUEUE-NAME] [SCRIPT-NAME]pnpm wrangler queues consumer remove [QUEUE-NAME] [SCRIPT-NAME]yarn wrangler queues consumer remove [QUEUE-NAME] [SCRIPT-NAME]-
[QUEUE-NAME]string requiredName of the queue to configure
-
[SCRIPT-NAME]string requiredName of the consumer script
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Add a Queue HTTP Pull Consumer
npx wrangler queues consumer http add [QUEUE-NAME]pnpm wrangler queues consumer http add [QUEUE-NAME]yarn wrangler queues consumer http add [QUEUE-NAME]-
[QUEUE-NAME]string requiredName of the queue for the consumer
-
--batch-sizenumberMaximum number of messages per batch
-
--message-retriesnumberMaximum number of retries for each message
-
--dead-letter-queuestringQueue to send messages that failed to be consumed
-
--visibility-timeout-secsnumberThe number of seconds a message will wait for an acknowledgement before being returned to the queue.
-
--retry-delay-secsnumberThe number of seconds to wait before retrying a message
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Remove a Queue HTTP Pull Consumer
npx wrangler queues consumer http remove [QUEUE-NAME]pnpm wrangler queues consumer http remove [QUEUE-NAME]yarn wrangler queues consumer http remove [QUEUE-NAME]-
[QUEUE-NAME]string requiredName of the queue for the consumer
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Add a Queue Worker Consumer
npx wrangler queues consumer worker add [QUEUE-NAME] [SCRIPT-NAME]pnpm wrangler queues consumer worker add [QUEUE-NAME] [SCRIPT-NAME]yarn wrangler queues consumer worker add [QUEUE-NAME] [SCRIPT-NAME]-
[QUEUE-NAME]string requiredName of the queue to configure
-
[SCRIPT-NAME]string requiredName of the consumer script
-
--batch-sizenumberMaximum number of messages per batch
-
--batch-timeoutnumberMaximum number of seconds to wait to fill a batch with messages
-
--message-retriesnumberMaximum number of retries for each message
-
--dead-letter-queuestringQueue to send messages that failed to be consumed
-
--max-concurrencynumberThe maximum number of concurrent consumer Worker invocations. Must be a positive integer
-
--retry-delay-secsnumberThe number of seconds to wait before retrying a message
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Remove a Queue Worker Consumer
npx wrangler queues consumer worker remove [QUEUE-NAME] [SCRIPT-NAME]pnpm wrangler queues consumer worker remove [QUEUE-NAME] [SCRIPT-NAME]yarn wrangler queues consumer worker remove [QUEUE-NAME] [SCRIPT-NAME]-
[QUEUE-NAME]string requiredName of the queue to configure
-
[SCRIPT-NAME]string requiredName of the consumer script
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Pause message delivery for a queue
npx wrangler queues pause-delivery [NAME]pnpm wrangler queues pause-delivery [NAME]yarn wrangler queues pause-delivery [NAME]-
[NAME]string requiredThe name of the queue
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Resume message delivery for a queue
npx wrangler queues resume-delivery [NAME]pnpm wrangler queues resume-delivery [NAME]yarn wrangler queues resume-delivery [NAME]-
[NAME]string requiredThe name of the queue
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Purge messages from a queue
npx wrangler queues purge [NAME]pnpm wrangler queues purge [NAME]yarn wrangler queues purge [NAME]-
[NAME]string requiredThe name of the queue
-
--forcebooleanSkip the confirmation dialog and forcefully purge the Queue
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create a new event subscription for a queue
npx wrangler queues subscription create [QUEUE]pnpm wrangler queues subscription create [QUEUE]yarn wrangler queues subscription create [QUEUE]-
[QUEUE]string requiredThe name of the queue to create the subscription for
-
--sourcestring requiredThe event source type
-
--eventsstring requiredComma-separated list of event types to subscribe to
-
--namestringName for the subscription (auto-generated if not provided)
-
--enabledboolean default: trueWhether the subscription should be active
-
--model-namestringWorkers AI model name (required for workersAi.model source)
-
--worker-namestringWorker name (required for workersBuilds.worker source)
-
--workflow-namestringWorkflow name (required for workflows.workflow source)
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List event subscriptions for a queue
npx wrangler queues subscription list [QUEUE]pnpm wrangler queues subscription list [QUEUE]yarn wrangler queues subscription list [QUEUE]-
[QUEUE]string requiredThe name of the queue to list subscriptions for
-
--pagenumber default: 1Page number for pagination
-
--per-pagenumber default: 20Number of subscriptions per page
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get details about a specific event subscription
npx wrangler queues subscription get [QUEUE]pnpm wrangler queues subscription get [QUEUE]yarn wrangler queues subscription get [QUEUE]-
[QUEUE]string requiredThe name of the queue
-
--idstring requiredThe ID of the subscription to retrieve
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete an event subscription from a queue
npx wrangler queues subscription delete [QUEUE]pnpm wrangler queues subscription delete [QUEUE]yarn wrangler queues subscription delete [QUEUE]-
[QUEUE]string requiredThe name of the queue
-
--idstring requiredThe ID of the subscription to delete
-
--forceboolean alias: --y default: falseSkip confirmation
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Update an existing event subscription
npx wrangler queues subscription update [QUEUE]pnpm wrangler queues subscription update [QUEUE]yarn wrangler queues subscription update [QUEUE]-
[QUEUE]string requiredThe name of the queue
-
--idstring requiredThe ID of the subscription to update
-
--namestringNew name for the subscription
-
--eventsstringComma-separated list of event types to subscribe to
-
--enabledbooleanWhether the subscription should be active
-
--jsonboolean default: falseOutput in JSON format
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Authorize Wrangler with your Cloudflare account using OAuth. Wrangler will attempt to automatically open your web browser to login with your Cloudflare account.
If you prefer to use API tokens for authentication, such as in headless or continuous integration environments, refer to Running Wrangler in CI/CD.
wrangler login [OPTIONS]--scopes-liststring optional- List all the available OAuth scopes with descriptions.
--scopesstring optional- Allows to choose your set of OAuth scopes. The set of scopes must be entered in a whitespace-separated list,
for example,
npx wrangler login --scopes account:read user:read.
- Allows to choose your set of OAuth scopes. The set of scopes must be entered in a whitespace-separated list,
for example,
--callback-hoststring optional- Defaults to
localhost. Sets the IP or hostname where Wrangler should listen for the OAuth callback.
- Defaults to
--callback-portstring optional- Defaults to
8976. Sets the port where Wrangler should listen for the OAuth callback.
- Defaults to
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
If Wrangler fails to open a browser, you can copy and paste the URL generated by wrangler login in your terminal into a browser and log in.
If you are using Wrangler from a remote machine, but run the login flow from your local browser, you will receive the following error message after logging in:This site can't be reached.
To finish the login flow, run wrangler login and go through the login flow in the browser:
npx wrangler login ⛅️ wrangler 2.1.6-------------------Attempting to login via OAuth...Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?xyz...The browser login flow will redirect you to a localhost URL on your machine.
Leave the login flow active. Open a second terminal session. In that second terminal session, use curl or an equivalent request library on the remote machine to fetch this localhost URL. Copy and paste the localhost URL that was generated during the wrangler login flow and run:
curl <LOCALHOST_URL>Remove Wrangler's authorization for accessing your account. This command will invalidate your current OAuth token.
wrangler logoutThe following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
If you are using CLOUDFLARE_API_TOKEN instead of OAuth, and you can logout by deleting your API token in the Cloudflare dashboard:
-
In the Cloudflare dashboard, go to the Account API tokens page.
Go to Account API tokens -
Select the three-dot menu on your Wrangler token.
-
Select Delete.
🕵️ Retrieve your user information
npx wrangler whoamipnpm wrangler whoamiyarn wrangler whoami-
--accountstringShow membership information for the given account (id or name).
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Upload a new version of your Worker that is not deployed immediately.
npx wrangler versions upload [SCRIPT]pnpm wrangler versions upload [SCRIPT]yarn wrangler versions upload [SCRIPT]-
[SCRIPT]stringThe path to an entry point for your Worker
-
--namestringName of the Worker
-
--tagstringA tag for this Worker Gradual Rollouts Version
-
--messagestringA descriptive message for this Worker Gradual Rollouts Version
-
--preview-aliasstringName of an alias for this Worker version
-
--no-bundleboolean default: falseSkip internal build steps and directly upload Worker
-
--outdirstringOutput directory for the bundled Worker
-
--outfilestringOutput file for the bundled worker
-
--compatibility-datestringDate to use for compatibility checks
-
--compatibility-flagsstring alias: --compatibility-flagFlags to use for compatibility checks
-
--latestboolean default: falseUse the latest version of the Worker runtime
-
--assetsstringStatic assets to be served. Replaces Workers Sites.
-
--varstringA key-value pair to be injected into the script as a variable
-
--definestringA key-value pair to be substituted in the script
-
--aliasstringA module pair to be substituted in the script
-
--jsx-factorystringThe function that is called for each JSX element
-
--jsx-fragmentstringThe function that is called for each JSX fragment
-
--tsconfigstringPath to a custom tsconfig.json file
-
--minifybooleanMinify the Worker
-
--upload-source-mapsbooleanInclude source maps when uploading this Worker Gradual Rollouts Version.
-
--dry-runbooleanCompile a project without actually uploading the version.
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Deploy a previously created version of your Worker all at once or create a gradual deployment to incrementally shift traffic to a new version by following an interactive prompt.
npx wrangler versions deploy [VERSION-SPECS]pnpm wrangler versions deploy [VERSION-SPECS]yarn wrangler versions deploy [VERSION-SPECS]-
--namestringName of the worker
-
--version-idstringWorker Version ID(s) to deploy
-
--percentagenumberPercentage of traffic to split between Worker Version(s) (0-100)
-
[VERSION-SPECS]stringShorthand notation to deploy Worker Version(s) [<version-id>@<percentage>..]
-
--messagestringDescription of this deployment (optional)
-
--yesboolean alias: --y default: falseAutomatically accept defaults to prompts
-
--dry-runboolean default: falseDon't actually deploy
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Retrieve details for the 10 most recent versions. Details include Version ID, Created on, Author, Source, and optionally, Tag or Message.
npx wrangler versions listpnpm wrangler versions listyarn wrangler versions list-
--namestringName of the Worker
-
--jsonboolean default: falseDisplay output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
View the details of a specific version of your Worker
npx wrangler versions view [VERSION-ID]pnpm wrangler versions view [VERSION-ID]yarn wrangler versions view [VERSION-ID]-
[VERSION-ID]string requiredThe Worker Version ID to view
-
--namestringName of the worker
-
--jsonboolean default: falseDisplay output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create or update a secret variable for a Worker
npx wrangler versions secret put [KEY]pnpm wrangler versions secret put [KEY]yarn wrangler versions secret put [KEY]-
[KEY]stringThe variable name to be accessible in the Worker
-
--namestringName of the Worker
-
--messagestringDescription of this deployment
-
--tagstringA tag for this version
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a secret variable from a Worker
npx wrangler versions secret delete [KEY]pnpm wrangler versions secret delete [KEY]yarn wrangler versions secret delete [KEY]-
[KEY]stringThe variable name to be accessible in the Worker
-
--namestringName of the Worker
-
--messagestringDescription of this deployment
-
--tagstringA tag for this version
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create or update a secret variable for a Worker
npx wrangler versions secret bulk [FILE]pnpm wrangler versions secret bulk [FILE]yarn wrangler versions secret bulk [FILE]-
[FILE]stringThe file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE
-
--namestringName of the Worker
-
--messagestringDescription of this deployment
-
--tagstringA tag for this version
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Updates the triggers of your current deployment
npx wrangler triggers deploypnpm wrangler triggers deployyarn wrangler triggers deploy-
--namestringName of the worker
-
--triggersstring aliases: --schedule, --schedulescron schedules to attach
-
--routesstring alias: --routeRoutes to upload
-
--dry-runbooleanDon't actually deploy
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Deployments track the version(s) of your Worker that are actively serving traffic.
Displays the 10 most recent deployments of your Worker
npx wrangler deployments listpnpm wrangler deployments listyarn wrangler deployments list-
--namestringName of the Worker
-
--jsonboolean default: falseDisplay output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
View the current state of your production
npx wrangler deployments statuspnpm wrangler deployments statusyarn wrangler deployments status-
--namestringName of the Worker
-
--jsonboolean default: falseDisplay output as clean JSON
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
wrangler rollback [<VERSION_ID>] [OPTIONS]VERSION_IDstring optional- The ID of the version you wish to roll back to. If not supplied, the
rollbackcommand defaults to the version uploaded before the latest version.
- The ID of the version you wish to roll back to. If not supplied, the
--namestring optional- Perform on a specific Worker rather than inheriting from the Wrangler configuration file.
--messagestring optional- Add message for rollback. Accepts empty string. When specified, interactive prompts for rollback confirmation and message are skipped.
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
List all dispatch namespaces
npx wrangler dispatch-namespace listpnpm wrangler dispatch-namespace listyarn wrangler dispatch-namespace listGlobal flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get information about a dispatch namespace
npx wrangler dispatch-namespace get [NAME]pnpm wrangler dispatch-namespace get [NAME]yarn wrangler dispatch-namespace get [NAME]-
[NAME]string requiredName of the dispatch namespace
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Create a dispatch namespace
npx wrangler dispatch-namespace create [NAME]pnpm wrangler dispatch-namespace create [NAME]yarn wrangler dispatch-namespace create [NAME]-
[NAME]string requiredName of the dispatch namespace
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a dispatch namespace
npx wrangler dispatch-namespace delete [NAME]pnpm wrangler dispatch-namespace delete [NAME]yarn wrangler dispatch-namespace delete [NAME]-
[NAME]string requiredName of the dispatch namespace
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Rename a dispatch namespace
npx wrangler dispatch-namespace rename [OLDNAME] [NEWNAME]pnpm wrangler dispatch-namespace rename [OLDNAME] [NEWNAME]yarn wrangler dispatch-namespace rename [OLDNAME] [NEWNAME]-
[OLDNAME]string requiredName of the dispatch namespace
-
[NEWNAME]string requiredNew name of the dispatch namespace
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Manage client certificates used for mTLS connections in subrequests.
These certificates can be used in mtls_certificate bindings, which allow a Worker to present the certificate when establishing a connection with an origin that requires client authentication (mTLS).
Upload an mTLS certificate
npx wrangler mtls-certificate uploadpnpm wrangler mtls-certificate uploadyarn wrangler mtls-certificate upload-
--certstring requiredThe path to a certificate file (.pem) containing a chain of certificates to upload
-
--keystring requiredThe path to a file containing the private key for your leaf certificate
-
--namestringThe name for the certificate
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of using the upload command to upload an mTLS certificate.
npx wrangler mtls-certificate upload --cert cert.pem --key key.pem --name my-origin-certUploading mTLS Certificate my-origin-cert...Success! Uploaded mTLS Certificate my-origin-certID: 99f5fef1-6cc1-46b8-bd79-44a0d5082b8dIssuer: CN=my-secured-origin.com,OU=my-team,O=my-org,L=San Francisco,ST=California,C=USExpires: 1/01/2025You can then add this certificate as a binding in your Wrangler configuration file:
{ "$schema": "./node_modules/wrangler/config-schema.json", "mtls_certificates": [ { "binding": "MY_CERT", "certificate_id": "99f5fef1-6cc1-46b8-bd79-44a0d5082b8d" } ]}mtls_certificates = [ { binding = "MY_CERT", certificate_id = "99f5fef1-6cc1-46b8-bd79-44a0d5082b8d" }]Note that the certificate and private keys must be in separate (typically .pem) files when uploading.
List uploaded mTLS certificates
npx wrangler mtls-certificate listpnpm wrangler mtls-certificate listyarn wrangler mtls-certificate listGlobal flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of using the list command to upload an mTLS certificate.
npx wrangler mtls-certificate listID: 99f5fef1-6cc1-46b8-bd79-44a0d5082b8dName: my-origin-certIssuer: CN=my-secured-origin.com,OU=my-team,O=my-org,L=San Francisco,ST=California,C=USCreated on: 1/01/2023Expires: 1/01/2025
ID: c5d004d1-8312-402c-b8ed-6194328d5cbeIssuer: CN=another-origin.com,OU=my-team,O=my-org,L=San Francisco,ST=California,C=USCreated on: 1/01/2023Expires: 1/01/2025Delete an mTLS certificate
npx wrangler mtls-certificate deletepnpm wrangler mtls-certificate deleteyarn wrangler mtls-certificate delete-
--idstringThe id of the mTLS certificate to delete
-
--namestringThe name of the mTLS certificate record to delete
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of using the delete command to delete an mTLS certificate.
npx wrangler mtls-certificate delete --id 99f5fef1-6cc1-46b8-bd79-44a0d5082b8dAre you sure you want to delete certificate 99f5fef1-6cc1-46b8-bd79-44a0d5082b8d (my-origin-cert)? [y/n]yesDeleting certificate 99f5fef1-6cc1-46b8-bd79-44a0d5082b8d...Deleted certificate 99f5fef1-6cc1-46b8-bd79-44a0d5082b8d successfullyManage mTLS client certificates and Certificate Authority (CA) chain certificates used for secured connections.
These certificates can be used in Hyperdrive configurations, enabling them to present the certificate when connecting to an origin database that requires client authentication (mTLS) or a custom Certificate Authority (CA).
Upload an mTLS certificate
npx wrangler cert upload mtls-certificatepnpm wrangler cert upload mtls-certificateyarn wrangler cert upload mtls-certificate-
--certstring requiredThe path to a certificate file (.pem) containing a chain of certificates to upload
-
--keystring requiredThe path to a file containing the private key for your leaf certificate
-
--namestringThe name for the certificate
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of using the upload command to upload an mTLS certificate.
npx wrangler cert upload --cert cert.pem --key key.pem --name my-origin-certUploading mTLS Certificate my-origin-cert...Success! Uploaded mTLS Certificate my-origin-certID: 99f5fef1-6cc1-46b8-bd79-44a0d5082b8dIssuer: CN=my-secured-origin.com,OU=my-team,O=my-org,L=San Francisco,ST=California,C=USExpires: 1/01/2025Note that the certificate and private keys must be in separate (typically .pem) files when uploading.
Upload a CA certificate chain
npx wrangler cert upload certificate-authoritypnpm wrangler cert upload certificate-authorityyarn wrangler cert upload certificate-authority-
--namestringThe name for the certificate
-
--ca-certstring requiredThe path to a certificate file (.pem) containing a chain of CA certificates to upload
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of using the upload command to upload an CA certificate.
npx wrangler cert upload certificate-authority --ca-cert server-ca-chain.pem --name SERVER_CA_CHAINUploading CA Certificate SERVER_CA_CHAIN...Success! Uploaded CA Certificate SERVER_CA_CHAINID: 99f5fef1-6cc1-46b8-bd79-44a0d5082b8dIssuer: CN=my-secured-origin.com,OU=my-team,O=my-org,L=San Francisco,ST=California,C=USExpires: 1/01/2025List uploaded mTLS certificates
npx wrangler cert listpnpm wrangler cert listyarn wrangler cert listGlobal flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of using the list command to upload an mTLS or CA certificate.
npx wrangler cert listID: 99f5fef1-6cc1-46b8-bd79-44a0d5082b8dName: my-origin-certIssuer: CN=my-secured-origin.com,OU=my-team,O=my-org,L=San Francisco,ST=California,C=USCreated on: 1/01/2023Expires: 1/01/2025
ID: c5d004d1-8312-402c-b8ed-6194328d5cbeIssuer: CN=another-origin.com,OU=my-team,O=my-org,L=San Francisco,ST=California,C=USCreated on: 1/01/2023Expires: 1/01/2025Delete an mTLS certificate
npx wrangler cert deletepnpm wrangler cert deleteyarn wrangler cert delete-
--idstringThe id of the mTLS certificate to delete
-
--namestringThe name of the mTLS certificate record to delete
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
The following is an example of using the delete command to delete an mTLS or CA certificate.
npx wrangler cert delete --id 99f5fef1-6cc1-46b8-bd79-44a0d5082b8dAre you sure you want to delete certificate 99f5fef1-6cc1-46b8-bd79-44a0d5082b8d (my-origin-cert)? [y/n]yesDeleting certificate 99f5fef1-6cc1-46b8-bd79-44a0d5082b8d...Deleted certificate 99f5fef1-6cc1-46b8-bd79-44a0d5082b8d successfullyGenerate types based on your Worker configuration, including Env types based on your bindings, module rules, and runtime types based on thecompatibility_date and compatibility_flags in your config file.
wrangler types [<PATH>] [OPTIONS]PATHstring (default: `./worker-configuration.d.ts`)- The path to where types for your Worker will be written.
- The path must have a
d.tsextension.
--env-interfacestring (default: `Env`)- The name of the interface to generate for the environment object.
- Not valid if the Worker uses the Service Worker syntax.
--include-runtimeboolean (default: true)- Whether to generate runtime types based on the
compatibility_dateandcompatibility_flagsin your config file.
- Whether to generate runtime types based on the
--include-envboolean (default: true)- Whether to generate
Envtypes based on your Worker bindings.
- Whether to generate
--strict-varsboolean optional (default: true)- Control the types that Wrangler generates for
varsbindings. - If
true, (the default) Wrangler generates literal and union types for bindings (e.g.myVar: 'my dev variable' | 'my prod variable'). - If
false, Wrangler generates generic types (e.g.myVar: string). This is useful when variables change frequently, especially when working across multiple environments.
- Control the types that Wrangler generates for
--config,-cstring[] optional- Path(s) to Wrangler configuration file. If the Worker you are generating types for has service bindings or bindings to Durable Objects, you can also provide the paths to those configuration files so that the generated
Envtype will include RPC types. For example, given a Worker with a service binding,wrangler types -c wrangler.toml -c ../bound-worker/wrangler.tomlwill generate anEnvtype like this:
TypeScript interface Env {SERVICE_BINDING: Service<import("../bound-worker/src/index").Entrypoint>;}- Path(s) to Wrangler configuration file. If the Worker you are generating types for has service bindings or bindings to Durable Objects, you can also provide the paths to those configuration files so that the generated
Cloudflare collects anonymous usage data to improve Wrangler. You can learn more about this in our data policy ↗.
You can manage sharing of usage data at any time using these commands.
Disable telemetry collection for Wrangler.
wrangler telemetry disableEnable telemetry collection for Wrangler.
wrangler telemetry enableCheck whether telemetry collection is currently enabled. The return result is specific to the directory where you have run the command.
This will resolve the global status set by wrangler telemetry disable / enable, the environment variable WRANGLER_SEND_METRICS, and the send_metrics key in the Wrangler configuration file.
wrangler telemetry statusThe following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Generate a CPU profile of your Worker's startup phase.
After you run wrangler check startup, you can import the profile into Chrome DevTools or open it directly in VSCode to view a flamegraph of your Worker's startup phase. Additionally, when a Worker deployment fails with a startup time error Wrangler will automatically generate a CPU profile for easy investigation.
wrangler check startup--argsstring optional- To customise the way
wrangler check startupbuilds your Worker for analysis, provide the exact arguments you use when deploying your Worker withwrangler deploy, or your Pages project withwrangler pages functions build. For instance, if you deploy your Worker withwrangler deploy --no-bundle, you should usewrangler check startup --args="--no-bundle"to profile the startup phase.
- To customise the way
--workerstring optional- If you don't use Wrangler to deploy your Worker, you can use this argument to provide a Worker bundle to analyse. This should be a file path to a serialized multipart upload, with the exact same format as the API expects.
--pagesboolean optional- If you don't use a Wrangler config file with your Pages project (i.e. a Wrangler config file containing
pages_build_output_dir), use this flag to forcewrangler check startupto treat your project as a Pages project.
- If you don't use a Wrangler config file with your Pages project (i.e. a Wrangler config file containing
The following global flags work on every command:
--helpboolean- Show help.
--configstring (not supported by Pages)- Path to your Wrangler configuration file.
--cwdstring- Run as if Wrangler was started in the specified directory instead of the current working directory.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-