Skip to content
Cloudflare Docs

WranglerCommand

WranglerCommand is used 14 times on 2 pages.

Pages which use WranglerCommand

Used 14 times.

Pages

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

import { WranglerCommand } from "~/components";

Usage

deploy

🆙 Deploy a Worker to Cloudflare

Terminal window
npx wrangler deploy [SCRIPT]
  • --script string

    The path to an entry point for your Worker

  • --name string

    Name of the Worker

  • --no-bundle boolean default: false

    Skip internal build steps and directly deploy Worker

  • --outdir string

    Output directory for the bundled Worker

  • --outfile string

    Output file for the bundled worker

  • --compatibility-date string

    Date to use for compatibility checks

  • --compatibility-flags string alias: --compatibility-flag

    Flags to use for compatibility checks

  • --latest boolean default: false

    Use the latest version of the Workers runtime

  • --assets string

    Static assets to be served. Replaces Workers Sites.

  • --var string

    A key-value pair to be injected into the script as a variable

  • --define string

    A key-value pair to be substituted in the script

  • --alias string

    A module pair to be substituted in the script

  • --triggers string aliases: --schedule, --schedules

    cron schedules to attach

  • --routes string alias: --route

    Routes to upload

  • --domains string alias: --domain

    Custom domains to deploy to

  • --jsx-factory string

    The function that is called for each JSX element

  • --jsx-fragment string

    The function that is called for each JSX fragment

  • --tsconfig string

    Path to a custom tsconfig.json file

  • --minify boolean

    Minify the Worker

  • --dry-run boolean

    Don't actually deploy

  • --metafile string

    Path to output build metadata from esbuild. If flag is used without a path, defaults to 'bundle-meta.json' inside the directory specified by --outdir.

  • --keep-vars boolean default: false

    When 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.

  • --logpush boolean

    Send Trace Events from this Worker to Workers Logpush. This will not configure a corresponding Logpush job automatically.

  • --upload-source-maps boolean

    Include source maps when uploading this Worker.

  • --old-asset-ttl number

    Expire old assets in given seconds rather than immediate deletion.

  • --dispatch-namespace string

    Name 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_steps if configured and roll out to 100% of instances in one step.

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

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

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

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

  • --env-file string

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

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

    Experimental: Enable Remote Bindings

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

    Experimental: Enable automatic resource provisioning

d1 execute

Execute a command or SQL file

Terminal window
npx wrangler d1 execute [DATABASE]
  • --database string required

    The name or binding of the DB

  • --yes boolean alias: --y

    Answer "yes" to any prompts

  • --local boolean

    Execute commands/files against a local DB for use with wrangler dev

  • --remote boolean

    Execute commands/files against a remote DB for use with wrangler dev

  • --file string

    A .sql file to ingest

  • --command string

    A single SQL statement to execute

  • --persist-to string

    Specify directory to use for local persistence (for --local)

  • --json boolean default: false

    Return output as clean JSON

  • --preview boolean default: false

    Execute commands/files against a preview D1 DB

Global flags

  • --v boolean alias: --version

    Show version number

  • --cwd string

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

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

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

  • --env-file string

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

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

    Experimental: Enable Remote Bindings

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

    Experimental: Enable automatic resource provisioning

import { WranglerCommand } from "~/components";
<WranglerCommand command="deploy" />
<WranglerCommand command="d1 execute" />

Arguments

  • command string required
    • The name of the command, i.e d1 execute.
  • headingLevel boolean (default: 2) optional
    • The heading level that the command name should be added at on the page, i.e 2 for a h2.
  • description string optional
    • A description to render below the command heading. If not set, defaults to the value specified in the Wrangler help API.