Skip to content
Cloudflare Docs

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

    import { WranglerNamespace } from "~/components";

    Usage

    d1 list

    List D1 databases

    Terminal window
    npx wrangler d1 list
    • --json boolean default: false

      Return output as clean JSON

    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 info

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

    Terminal window
    npx wrangler d1 info [NAME]
    • --name string required

      The name of the DB

    • --json boolean default: false

      Return output as clean JSON

    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 insights

    Get information about the queries run on a D1 database.

    Terminal window
    npx wrangler d1 insights [NAME]
    • --name string required

      The name of the DB

    • --timePeriod string default: 1d

      Fetch data from now to the provided time period

    • --sort-type string default: sum

      Choose the operation you want to sort insights by

    • --sort-by string default: time

      Choose the field you want to sort insights by

    • --sort-direction string default: DESC

      Choose a sort direction

    • --limit number default: 5

      fetch insights about the first X queries

    • --json boolean default: false

      return output as clean JSON

    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 create

    Create D1 database

    Terminal window
    npx wrangler d1 create [NAME]
    • --name string required

      The name of the new DB

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

    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 delete

    Delete D1 database

    Terminal window
    npx wrangler d1 delete [NAME]
    • --name string required

      The name or binding of the DB

    • --skip-confirmation boolean alias: --y default: false

      Skip confirmation

    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

    d1 export

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

    Terminal window
    npx wrangler d1 export [NAME]
    • --name string required

      The name of the DB

    • --local boolean

      Export from your local DB you use with wrangler dev

    • --remote boolean

      Export from your live D1

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

    • --table string

      Specify which tables to include in export

    • --output string required

      Which .sql file to output to

    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 time-travel info

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

    Terminal window
    npx 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 clean JSON

    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 time-travel restore

    Restore a database back to a specific point-in-time

    Terminal window
    npx wrangler d1 time-travel restore [DATABASE]
    • --database string required

      The name or binding of the DB

    • --bookmark string

      Bookmark to use for time travel

    • --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 clean JSON

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

    List your D1 migrations

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

      The name or binding of the DB

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

    • --preview boolean default: false

      Execute commands/files against a preview D1 DB

    • --persist-to string

      Specify directory to use for local persistence (you must use --local with this flag)

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

    Create a new migration

    Terminal window
    npx wrangler d1 migrations create [DATABASE] [MESSAGE]
    • --database string required

      The name or binding of the DB

    • --message string required

      The Migration message

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

    Apply D1 migrations

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

      The name or binding of the DB

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

    • --preview boolean default: false

      Execute commands/files against a preview D1 DB

    • --persist-to string

      Specify directory to use for local persistence (you must use --local with this flag)

    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 { WranglerNamespace } from "~/components";
    <WranglerNamespace namespace="d1" />

    Arguments

    • namespace string required
      • The namespace to pull the related commands from (d1, hyperdrive).
    • headingLevel boolean (default: 2) optional
      • The heading level that the commands should be added at on the page, i.e 2 for h2.