WranglerNamespace
WranglerNamespace
is used 2
times on 2
pages.
Pages which use WranglerNamespace
Used 2 times.
Pages
Partials
The WranglerNamespace
component documents the available commands for a given namespace.
This is generated using the Wrangler version in the cloudflare-docs
repository ↗.
import { WranglerNamespace } from "~/components";
List D1 databases
npx wrangler d1 list
pnpm wrangler d1 list
yarn wrangler d1 list
-
--json
boolean default: falseReturn output as clean JSON
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Get information about a D1 database, including the current database size and state
npx wrangler d1 info [NAME]
pnpm wrangler d1 info [NAME]
yarn wrangler d1 info [NAME]
-
--name
string requiredThe name of the DB
-
--json
boolean default: falseReturn output as clean JSON
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Get information about the queries run on a D1 database.
npx wrangler d1 insights [NAME]
pnpm wrangler d1 insights [NAME]
yarn wrangler d1 insights [NAME]
-
--name
string requiredThe name of the DB
-
--timePeriod
string default: 1dFetch data from now to the provided time period
-
--sort-type
string default: sumChoose the operation you want to sort insights by
-
--sort-by
string default: timeChoose the field you want to sort insights by
-
--sort-direction
string default: DESCChoose a sort direction
-
--limit
number default: 5fetch insights about the first X queries
-
--json
boolean default: falsereturn output as clean JSON
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Create D1 database
npx wrangler d1 create [NAME]
pnpm wrangler d1 create [NAME]
yarn wrangler d1 create [NAME]
-
--name
string requiredThe name of the new DB
-
--location
stringA 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
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Delete D1 database
npx wrangler d1 delete [NAME]
pnpm wrangler d1 delete [NAME]
yarn wrangler d1 delete [NAME]
-
--name
string requiredThe name or binding of the DB
-
--skip-confirmation
boolean alias: --y default: falseSkip confirmation
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Execute a command or SQL file
npx wrangler d1 execute [DATABASE]
pnpm wrangler d1 execute [DATABASE]
yarn wrangler d1 execute [DATABASE]
-
--database
string requiredThe name or binding of the DB
-
--yes
boolean alias: --yAnswer "yes" to any prompts
-
--local
booleanExecute commands/files against a local DB for use with wrangler dev
-
--remote
booleanExecute commands/files against a remote DB for use with wrangler dev
-
--file
stringA .sql file to ingest
-
--command
stringA single SQL statement to execute
-
--persist-to
stringSpecify directory to use for local persistence (for --local)
-
--json
boolean default: falseReturn output as clean JSON
-
--preview
boolean default: falseExecute commands/files against a preview D1 DB
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Export the contents or schema of your database as a .sql file
npx wrangler d1 export [NAME]
pnpm wrangler d1 export [NAME]
yarn wrangler d1 export [NAME]
-
--name
string requiredThe name of the DB
-
--local
booleanExport from your local DB you use with wrangler dev
-
--remote
booleanExport from your live D1
-
--no-schema
booleanOnly output table contents, not the DB schema
-
--no-data
booleanOnly output table schema, not the contents of the DBs themselves
-
--table
stringSpecify which tables to include in export
-
--output
string requiredWhich .sql file to output to
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Retrieve information about a database at a specific point-in-time using Time Travel
npx wrangler d1 time-travel info [DATABASE]
pnpm wrangler d1 time-travel info [DATABASE]
yarn wrangler d1 time-travel info [DATABASE]
-
--database
string requiredThe name or binding of the DB
-
--timestamp
stringAccepts a Unix (seconds from epoch) or RFC3339 timestamp (e.g. 2023-07-13T08:46:42.228Z) to retrieve a bookmark for
-
--json
boolean default: falseReturn output as clean JSON
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Restore a database back to a specific point-in-time
npx wrangler d1 time-travel restore [DATABASE]
pnpm wrangler d1 time-travel restore [DATABASE]
yarn wrangler d1 time-travel restore [DATABASE]
-
--database
string requiredThe name or binding of the DB
-
--bookmark
stringBookmark to use for time travel
-
--timestamp
stringAccepts a Unix (seconds from epoch) or RFC3339 timestamp (e.g. 2023-07-13T08:46:42.228Z) to retrieve a bookmark for
-
--json
boolean default: falseReturn output as clean JSON
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
List your D1 migrations
npx wrangler d1 migrations list [DATABASE]
pnpm wrangler d1 migrations list [DATABASE]
yarn wrangler d1 migrations list [DATABASE]
-
--database
string requiredThe name or binding of the DB
-
--local
booleanExecute commands/files against a local DB for use with wrangler dev
-
--remote
booleanExecute commands/files against a remote DB for use with wrangler dev --remote
-
--preview
boolean default: falseExecute commands/files against a preview D1 DB
-
--persist-to
stringSpecify directory to use for local persistence (you must use --local with this flag)
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Create a new migration
npx wrangler d1 migrations create [DATABASE] [MESSAGE]
pnpm wrangler d1 migrations create [DATABASE] [MESSAGE]
yarn wrangler d1 migrations create [DATABASE] [MESSAGE]
-
--database
string requiredThe name or binding of the DB
-
--message
string requiredThe Migration message
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Apply D1 migrations
npx wrangler d1 migrations apply [DATABASE]
pnpm wrangler d1 migrations apply [DATABASE]
yarn wrangler d1 migrations apply [DATABASE]
-
--database
string requiredThe name or binding of the DB
-
--local
booleanExecute commands/files against a local DB for use with wrangler dev
-
--remote
booleanExecute commands/files against a remote DB for use with wrangler dev --remote
-
--preview
boolean default: falseExecute commands/files against a preview D1 DB
-
--persist-to
stringSpecify directory to use for local persistence (you must use --local with this flag)
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath 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-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
import { WranglerNamespace } from "~/components";
<WranglerNamespace namespace="d1" />
namespace
string required- The namespace to pull the related commands from (
d1
,hyperdrive
).
- The namespace to pull the related commands from (
headingLevel
boolean (default: 2) optional- The heading level that the commands should be added at on the page, i.e
2
forh2
.
- The heading level that the commands should be added at on the page, i.e
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