Workers (3)·续4
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
triggers
Note
The minimum required wrangler version to use these commands is 3.40.0. For versions before 3.73.0, you will need to add the --x-versions flag.
triggers deploy
Experimental
Apply changes to triggers (Routes or domains and Cron Triggers) when using wrangler versions upload
npmyarnpnpm
npx wrangler triggers deploy
yarn wrangler triggers deploy
pnpm wrangler triggers deploy
--namestringName of the worker--triggersstringaliases: --schedule, --schedules
cron schedules to attach
- --routes string alias: --route
Routes to upload
- --experimental-route-zones boolean aliases: --x-route-zonesdefault: false
Experimental: Enable the --zone and --zone-id flags to attach a zone to the routes passed via --route
- --zone string alias: --zones
Experimental (requires --x-route-zones): Zone name for the routes passed via --route. Pass one value to apply it to all routes, or one value per --route in the same order
- --zone-id string alias: --zone-ids
Experimental (requires --x-route-zones): Zone ID for the routes passed via --route. Pass one value to apply it to all routes, or one value per --route in the same order
- --dry-run boolean default: false
Don't actually deploy
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
deployments
Deployments track the version(s) of your Worker that are actively serving traffic.
Note
The minimum required wrangler version to use these commands is 3.40.0. For versions before 3.73.0, you will need to add the --x-versions flag.
deployments list
Displays the 10 most recent deployments of your Worker
npmyarnpnpm
npx wrangler deployments list
yarn wrangler deployments list
pnpm wrangler deployments list
--namestringName of the Worker--jsonbooleandefault: false
Display output as JSON
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
deployments status
View the current state of your production
npmyarnpnpm
npx wrangler deployments status
yarn wrangler deployments status
pnpm wrangler deployments status
--namestringName of the Worker--jsonbooleandefault: false
Display output as JSON
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
rollback
Caution
A rollback will immediately create a new deployment with the specified version of your Worker and become the active deployment across all your deployed routes and domains. This change will not affect work in your local development environment.
wrangler rollback [<VERSION_ID>] [OPTIONS]
VERSION_IDstringoptional- 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. --namestringoptional- Perform on a specific Worker rather than inheriting from the Wrangler configuration file.
--messagestringoptional- 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.
types
Generate 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]
Note
If you are running a version of Wrangler that is greater than 3.66.0 but below 4.0.0, you will need to include the --experimental-include-runtime flag. During its experimental release, runtime types were output to a separate file (.wrangler/types/runtime.d.ts by default). If you have an older version of Wrangler, you can access runtime types through the @cloudflare/workers-types package.
Multi-environment support
By default, wrangler types generates types for bindings from all environments defined in your configuration file. This ensures your generated Env type includes all bindings that might be used across different deployment environments (such as staging and production), preventing TypeScript errors when accessing environment-specific bindings.
For example, if you have a KV namespace binding only in production and an R2 bucket binding only in staging, both will be included in the generated types as optional properties.
To generate types for only a specific environment, use the --env flag.
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. --envstringoptional- Generate types for bindings in a specific environment only, rather than aggregating bindings from all environments.
--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. --include-envboolean(default: true)- Whether to generate
Envtypes based on your Worker bindings. --strict-varsbooleanoptional (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. --checkbooleanoptional- Compare the generated file's recorded environment/configuration hash and runtime header with the current Wrangler configuration and runtime inputs.
- This does not compare or validate the generated file body or regenerate the file.
- Exits with code 0 if types are up-to-date, or code 1 if types are out-of-date.
- Useful for CI/CD pipelines and pre-commit hooks to detect input changes that require regeneration.
--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:
interface Env {
SERVICE_BINDING: Service<import("../bound-worker/src/index").Entrypoint>;
}
```
---
## `check`
### `startup`
Analyze your Worker's startup phase. Wrangler reports bundle size and a summary of local CPU activity. It also saves a detailed CPU profile.
```sh
wrangler check startup
Bundle: 42.31 KiB / gzip: 11.24 KiB
Local startup profile:
Profile window: 25.2 ms
Sampled time: 24.8 ms
Active: 18.4 ms (including 1.2 ms garbage collection)
Idle: 6.4 ms
Samples: 25
The local startup profile includes the following metrics:
| Metric | Description |
|---|---|
| Profile window | Elapsed time between the start and end of the profiling session. |
| Sampled time | Total time represented by the captured CPU samples. |
| Active | Sampled time that the Worker was not idle, including garbage collection. |
| Idle | Sampled time that the Worker was idle. |
| Samples | Number of CPU samples captured during the profiling session. |
Import the generated .cpuprofile file into Chrome DevTools or open it directly in VS Code to view a flamegraph. When a Worker deployment fails with a startup time error, Wrangler also generates this profile automatically.
Note
This command measures performance of your Worker locally, on your own machine — which has a different CPU than when your Worker runs on Cloudflare. This means results can vary widely.
Use the summary and CPU profile to understand where your Worker spends time during startup. Do not expect the local profile duration to match your Worker's startup time on Cloudflare.
--argsstringoptional- 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. --workerstringoptional- 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.
--pagesbooleanoptional- 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.
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?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/workers/wrangler/commands/workers/#page","headline":"Workers","description":"Wrangler commands for creating, developing, deploying, and managing Workers.","url":"https://developers.cloudflare.com/workers/wrangler/commands/workers/","inLanguage":"en","image":"https://developers.cloudflare.com/workers/wrangler/commands/workers/og.png?v=23e946081c972e5c","dateModified":"2026-10-26","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Wrangler commands for managing Workers for Platforms dispatch namespaces. title: Workers for Platforms image: https://developers.cloudflare.com/workers/wrangler/commands/workers-for-platforms/og.png?v=71d2e50bea2db143
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt
Use this file to discover all available pages before exploring further.
Docs