WranglerCommand
The WranglerCommand component is used 90 times on 7 pages.
See all examples of pages that use WranglerCommand
Used 90 times.
Pages
- /workers/wrangler/commands/certificates/ - Source
- /workers/wrangler/commands/general/ - Source
- /workers/wrangler/commands/secrets-store/ - Source
- /workers/wrangler/commands/workers-for-platforms/ - Source
Partials
The WranglerCommand component documents the available options for a given command.
This is generated using the Wrangler version in the cloudflare-docs repository ↗.
import { WranglerCommand } from "~/components";Deploy a Worker
npx wrangler deploy [SCRIPT]pnpm wrangler deploy [SCRIPT]yarn wrangler deploy [SCRIPT]-
[SCRIPT]stringThe path to an entry point for your Worker
-
--namestringName of the Worker
-
--no-bundlebooleandefault: falseSkip internal build steps and directly deploy Worker
-
--outdirstringOutput directory for the bundled Worker
-
--outfilestringOutput file for the bundled worker
-
--compatibility-datestringDate to use for compatibility checks
-
--compatibility-flagsstringalias: --compatibility-flagFlags to use for compatibility checks
-
--latestbooleandefault: falseUse the latest version of the Workers 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
-
--triggersstringaliases: --schedule, --schedulescron schedules to attach
-
--routesstringalias: --routeRoutes to upload
-
--domainsstringalias: --domainCustom domains to deploy to
-
--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
-
--dry-runbooleanDon't actually deploy
-
--metafilestringPath to output build metadata from esbuild. If flag is used without a path, defaults to 'bundle-meta.json' inside the directory specified by --outdir.
-
--keep-varsbooleandefault: falseWhen not used (or set to false), Wrangler will delete all vars before setting those found in the Wrangler configuration. When used (and set to true), the environment variables are not deleted before the deployment. If you set variables via the dashboard you probably want to use this flag. Note that secrets are never deleted by deployments.
-
--logpushbooleanSend Trace Events from this Worker to Workers Logpush. This will not configure a corresponding Logpush job automatically.
-
--upload-source-mapsbooleanInclude source maps when uploading this Worker.
-
--old-asset-ttlnumberExpire old assets in given seconds rather than immediate deletion.
-
--dispatch-namespacestringName of a dispatch namespace to deploy the Worker to (Workers for Platforms)
-
--containers-rollout"immediate" | "gradual"Rollout strategy for Containers changes. If set to immediate, it will override
rollout_percentage_stepsif configured and roll out to 100% of instances in one step. -
--tagstringA tag for this Worker Version
-
--messagestringA descriptive message for this Worker Version and Deployment
-
--strictbooleandefault: falseEnables strict mode for the deploy command, this prevents deployments to occur when there are even small potential risks.
-
--experimental-autoconfigbooleanaliases: --x-autoconfig default: trueExperimental: Enables framework detection and automatic configuration when deploying
-
--secrets-filestringPath to a file containing secrets to upload with the deployment (JSON or .env format). Secrets from previous deployments will not be deleted - see
--keep-secrets
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --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-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Execute a command or SQL file
You must provide either --command or --file for this command to run successfully.
npx wrangler d1 execute [DATABASE]pnpm wrangler d1 execute [DATABASE]yarn wrangler d1 execute [DATABASE]-
[DATABASE]stringrequiredThe name or binding of the DB
-
--commandstringThe SQL query you wish to execute, or multiple queries separated by ';'
-
--filestringA .sql file to ingest
-
--yesbooleanalias: --yAnswer "yes" to any prompts
-
--localbooleanExecute commands/files against a local DB for use with wrangler dev
-
--remotebooleanExecute commands/files against a remote D1 database for use with remote bindings or your deployed Worker
-
--persist-tostringSpecify directory to use for local persistence (for use with --local)
-
--jsonbooleandefault: falseReturn output as JSON
-
--previewbooleandefault: falseExecute commands/files against a preview D1 database
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --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-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
import { WranglerCommand } from "~/components";
<WranglerCommand command="deploy" description={"Deploy a [Worker](/workers/)"}/>
<WranglerCommand command="d1 execute" />You can add or replace help text for specific flags using the ExtraFlagDetails component:
🆙 Deploy a Worker to Cloudflare
npx wrangler deploy [SCRIPT]pnpm wrangler deploy [SCRIPT]yarn wrangler deploy [SCRIPT]-
[SCRIPT]stringThe path to an entry point for your Worker
-
--namestringName of the Worker
-
--no-bundlebooleandefault: falseSkip internal build steps and directly deploy Worker
-
--outdirstringOutput directory for the bundled Worker
-
--outfilestringOutput file for the bundled worker
-
--compatibility-datestringCustom help text that completely replaces the original description for this flag.
-
--compatibility-flagsstringalias: --compatibility-flagFlags to use for compatibility checks
-
--latestbooleandefault: falseUse the latest version of the Workers 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
-
--triggersstringaliases: --schedule, --schedulescron schedules to attach
-
--routesstringalias: --routeRoutes to upload
-
--domainsstringalias: --domainCustom domains to deploy to
-
--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
-
--dry-runbooleanDon't actually deploy
Additional details about the dry-run flag that will be appended to the original help text. Here is a link ↗ for more information.
-
--metafilestringPath to output build metadata from esbuild. If flag is used without a path, defaults to 'bundle-meta.json' inside the directory specified by --outdir.
-
--keep-varsbooleandefault: falseWhen not used (or set to false), Wrangler will delete all vars before setting those found in the Wrangler configuration. When used (and set to true), the environment variables are not deleted before the deployment. If you set variables via the dashboard you probably want to use this flag. Note that secrets are never deleted by deployments.
-
--logpushbooleanSend Trace Events from this Worker to Workers Logpush. This will not configure a corresponding Logpush job automatically.
-
--upload-source-mapsbooleanInclude source maps when uploading this Worker.
-
--old-asset-ttlnumberExpire old assets in given seconds rather than immediate deletion.
-
--dispatch-namespacestringName of a dispatch namespace to deploy the Worker to (Workers for Platforms)
-
--containers-rollout"immediate" | "gradual"Rollout strategy for Containers changes. If set to immediate, it will override
rollout_percentage_stepsif configured and roll out to 100% of instances in one step. -
--tagstringA tag for this Worker Version
-
--messagestringA descriptive message for this Worker Version and Deployment
-
--strictbooleandefault: falseEnables strict mode for the deploy command, this prevents deployments to occur when there are even small potential risks.
-
--experimental-autoconfigbooleanaliases: --x-autoconfig default: trueExperimental: Enables framework detection and automatic configuration when deploying
-
--secrets-filestringPath to a file containing secrets to upload with the deployment (JSON or .env format). Secrets from previous deployments will not be deleted - see
--keep-secrets
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --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-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
import { WranglerCommand, ExtraFlagDetails } from "~/components";
<WranglerCommand command="deploy"> <ExtraFlagDetails key="dry-run"> Additional details about the dry-run flag that will be appended to the original help text. Here is a [link](https://cloudflare.com) for more information. </ExtraFlagDetails> <ExtraFlagDetails key="compatibility-date" mode="replace"> Custom help text that completely replaces the original description for this flag. </ExtraFlagDetails></WranglerCommand>commandstringrequired- The name of the command, i.e
d1 execute.
- The name of the command, i.e
headingLevelboolean(default: 2) optional- The heading level that the command name should be added at on the page, i.e
2for ah2.
- The heading level that the command name should be added at on the page, i.e
descriptionstringoptional- A description to render below the command heading. If not set, defaults to the value specified in the Wrangler help API.