Wrangler commands (5)

Last updated Apr 21, 2026 D1 Wrangler commands use REST APIs to interact with the control plane. This page lists the Wrangler commands for D1.

d1 create

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

This command acts on remote D1 Databases.

npmyarnpnpm

npx wrangler d1 create <NAME>
yarn wrangler d1 create <NAME>
pnpm wrangler d1 create <NAME>
  • <NAME> string required

The name of the new D1 database - --location string A hint for the primary location of the new DB. Options: weur: Western Europe eeur: Eastern Europe apac: Asia Pacific oc: Oceania wnam: Western North America enam: Eastern North America - --jurisdiction string The location to restrict the D1 database to run and store data within to comply with local regulations. Note that if jurisdictions are set, the location hint is ignored. Options: eu: The European Union fedramp: FedRAMP-compliant data centers us: The United States - --use-remote boolean Use a remote binding when adding the newly created resource to your config - --update-config boolean Automatically update your config file with the newly added resource - --binding string The binding name of this resource in your Worker

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

d1 info

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

This command acts on remote D1 Databases.

npmyarnpnpm

npx wrangler d1 info <NAME>
yarn wrangler d1 info <NAME>
pnpm wrangler d1 info <NAME>
  • <NAME> string required

The name of the DB - --json boolean default: false

Return 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>

d1 list

List all D1 databases in your account

This command acts on remote D1 Databases.

npmyarnpnpm

npx wrangler d1 list
yarn wrangler d1 list
pnpm wrangler d1 list
  • --json boolean default: false

Return 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>

d1 delete

Delete a D1 database

This command acts on remote D1 Databases.

npmyarnpnpm

npx wrangler d1 delete <NAME>
yarn wrangler d1 delete <NAME>
pnpm wrangler d1 delete <NAME>
  • <NAME> string required

The name or binding of the DB - --skip-confirmation boolean alias: --ydefault: false

Skip confirmation

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

d1 execute

Execute a command or SQL file

You must provide either --command or --file for this command to run successfully.

npmyarnpnpm

npx wrangler d1 execute <DATABASE>
yarn wrangler d1 execute <DATABASE>
pnpm wrangler d1 execute <DATABASE>
  • <DATABASE> string required

The name or binding of the DB - --command string The SQL query you wish to execute, or multiple queries separated by ';' - --file string A .sql file to ingest - --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 D1 database for use with remote bindings or your deployed Worker - --persist-to string Specify directory to use for local persistence (for use with --local) - --json boolean default: false

Return output as JSON - --preview boolean default: false

Execute commands/files against a preview D1 database

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

d1 export

Export the contents or schema of your database as a .sql file

npmyarnpnpm

npx wrangler d1 export <NAME>
yarn wrangler d1 export <NAME>
pnpm wrangler d1 export <NAME>
  • <NAME> string required

The name of the D1 database to export - --local boolean Export from your local DB you use with wrangler dev - --remote boolean Export from a remote D1 database - --skip-confirmation boolean alias: --ydefault: false

Skip confirmation - --output string required

Path to the SQL file for your export - --table string Specify which tables to include in export - --no-schema boolean Only output table contents, not the DB schema - --no-data boolean Only output table schema, not the contents of the DBs themselves

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

d1 time-travel info

Retrieve information about a database at a specific point-in-time using Time Travel

This command acts on remote D1 Databases.

For more information about Time Travel, see https://developers.cloudflare.com/d1/reference/time-travel/

npmyarnpnpm

npx wrangler d1 time-travel info <DATABASE>
yarn wrangler d1 time-travel info <DATABASE>
pnpm wrangler d1 time-travel info <DATABASE>
  • <DATABASE> string required

The name or binding of the DB - --timestamp string Accepts a Unix (seconds from epoch) or RFC3339 timestamp (e.g. 2023-07-13T08:46:42.228Z) to retrieve a bookmark for - --json boolean default: false

Return 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