diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index 9f34d3a860e2af2..c0e55b0ead6534b 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -44,16 +44,7 @@ Wrangler offers a number of commands to manage your Cloudflare Workers. :::note -The following global flags work on every command, with some exceptions for `pages` commands. - -- `--help` - - Show help. -- `--version` - - Show version number. -- `--config` (not supported by Pages) - - Path to `.toml` configuration file. -- `--experimental-json-config` (not supported by Pages) - - ⚠️ This is an experimental command. Read configuration from a `wrangler.json` file, instead of `wrangler.toml`. `wrangler.json` is a [JSONC](https://code.visualstudio.com/docs/languages/json#_json-with-comments) file. + ::: @@ -137,6 +128,8 @@ wrangler docs [] - `COMMAND` - The Wrangler command you want to learn more about. This opens your default browser to the section of the documentation that describes the command. + + ## `init` :::note @@ -159,6 +152,8 @@ wrangler init [] [OPTIONS] - Fetch a Worker initialized from the dashboard. This is done by passing the flag and the Worker name. `wrangler init --from-dash `. - The `--from-dash` command will not automatically sync changes made to the dashboard after the command is used. Therefore, it is recommended that you continue using the CLI. + + --- ## `generate` @@ -180,6 +175,8 @@ wrangler generate [] [TEMPLATE] - `TEMPLATE` - The URL of a GitHub template, with a default [worker-template](https://github.com/cloudflare/worker-template). Browse a list of available templates on the [cloudflare/workers-sdk](https://github.com/cloudflare/workers-sdk/tree/main/templates#usage) repository. + + --- ## `d1` @@ -200,6 +197,8 @@ wrangler d1 create [OPTIONS] - Provide an optional [location hint](/d1/configuration/data-location/) for your database leader. - Available options include `weur` (Western Europe), `eeur` (Eastern Europe), `apac` (Asia Pacific), `oc` (Oceania), `wnam` (Western North America), and `enam` (Eastern North America). + + ### `info` Get information about a D1 database, including the current database size and state. @@ -213,6 +212,8 @@ wrangler d1 info [OPTIONS] - `--json` - Return output as JSON rather than a table. + + ### `list` List all D1 databases in your account. @@ -224,6 +225,8 @@ wrangler d1 list [OPTIONS] - `--json` - Return output as JSON rather than a table. + + ### `delete` Delete a D1 database. @@ -237,6 +240,8 @@ wrangler d1 delete [OPTIONS] - `-y, --skip-confirmation` - Skip deletion confirmation prompt. + + ### `execute` Execute a query on a D1 database. @@ -272,6 +277,8 @@ You must provide either `--command` or `--file` for this command to run successf - `--batch-size` - Number of queries to send in a single batch. + + ### `export` Export a D1 database or table's schema and/or content to a `.sql` file. @@ -293,6 +300,8 @@ wrangler d1 export [OPTIONS] - `--no-schema` - Controls whether export SQL file contains database schema. Note that `--no-schema=true` is not recommended due to a known wrangler limitation that intreprets the value as false. + + ### `time-travel restore` Restore a database to a specific point-in-time using [Time Travel](/d1/reference/time-travel/). @@ -310,6 +319,8 @@ wrangler d1 time-travel restore [OPTIONS] - `--json` - Return output as JSON rather than a table. + + ### `time-travel info` Inspect the current state of a database for a specific point-in-time using [Time Travel](/d1/reference/time-travel/). @@ -325,6 +336,8 @@ wrangler d1 time-travel info [OPTIONS] - `--json` b - Return output as JSON rather than a table. + + ### `backup create` :::caution @@ -343,6 +356,8 @@ wrangler d1 backup create - `DATABASE_NAME` - The name of the D1 database to backup. + + ### `backup list` :::caution @@ -361,6 +376,8 @@ wrangler d1 backup list - `DATABASE_NAME` - The name of the D1 database to list the backups of. + + ### `backup restore` :::caution @@ -381,6 +398,8 @@ wrangler d1 backup restore - `BACKUP_ID` - The ID of the backup you wish to restore. + + ### `backup download` :::caution @@ -403,6 +422,8 @@ wrangler d1 backup download - `--output` - The `.sqlite3` file to write to (defaults to `'..sqlite3'`). + + ### `migrations create` Create a new migration. @@ -422,6 +443,8 @@ wrangler d1 migrations create - `MIGRATION_NAME` - A descriptive name for the migration you wish to create. + + ### `migrations list` View a list of unapplied migration files. @@ -441,6 +464,8 @@ wrangler d1 migrations list [OPTIONS] - `--preview` - Show the list of unapplied migration files on your preview D1 database (as defined by `preview_database_id` in [`wrangler.toml`](/workers/wrangler/configuration/#d1-databases)). + + ### `migrations apply` Apply any unapplied migrations. @@ -472,6 +497,8 @@ wrangler d1 migrations apply [OPTIONS] - `--batch-size` - Number of queries to send in a single batch. + + --- ## `hyperdrive` @@ -505,6 +532,8 @@ npx wrangler vectorize create [--dimensions=] [--me - `--deprecated-v1` - Create a legacy Vectorize index. Please note that legacy Vectorize indexes are on a [deprecation path](/vectorize/reference/transition-vectorize-legacy). + + ### `list` List all Vectorize indexes in your account, including the configured dimensions and distance metric. @@ -516,6 +545,8 @@ npx wrangler vectorize list - `--deprecated-v1` - List legacy Vectorize indexes. Please note that legacy Vectorize indexes are on a [deprecation path](/vectorize/reference/transition-vectorize-legacy). + + ### `get` Get details about an individual index, including its configuration. @@ -529,6 +560,8 @@ npx wrangler vectorize get - `--deprecated-v1` - Get a legacy Vectorize index. Please note that legacy Vectorize indexes are on a [deprecation path](/vectorize/reference/transition-vectorize-legacy). + + ### `info` Get some additional information about an individual index, including the vector count and details about the last processed mutation. @@ -540,6 +573,8 @@ npx wrangler vectorize info - `INDEX_NAME` - The name of the index to fetch details for. + + ### `delete` Delete a Vectorize index. @@ -555,6 +590,8 @@ npx wrangler vectorize delete [OPTIONS] - `--deprecated-v1` - Delete a legacy Vectorize index. Please note that legacy Vectorize indexes are on a [deprecation path](/vectorize/reference/transition-vectorize-legacy). + + ### `insert` Insert vectors into an index. @@ -572,6 +609,8 @@ npx wrangler vectorize insert [OPTIONS] - `--deprecated-v1` - Insert into a legacy Vectorize index. Please note that legacy Vectorize indexes are on a [deprecation path](/vectorize/reference/transition-vectorize-legacy). + + ### `upsert` Upsert vectors into an index. Existing vectors in the index would be overwritten. @@ -587,6 +626,8 @@ npx wrangler vectorize upsert [OPTIONS] - `--batch-size` - The number of vectors to insert at a time (default: `5000`). + + ### `query` Query a Vectorize index for similar vectors. @@ -612,6 +653,8 @@ npx wrangler vectorize query [OPTIONS] - `--filter` - Filter vectors based on this metadata filter. Example: `'{ 'p1': 'abc', 'p2': { '$ne': true }, 'p3': 10, 'p4': false, 'nested.p5': 'abcd' }'` + + ### `get-vectors` Fetch vectors from a Vectorize index using the provided ids. @@ -625,6 +668,8 @@ npx wrangler vectorize get-vectors [OPTIONS] - `--ids` - List of ids for which vectors must be fetched. + + ### `delete-vectors` Delete vectors in a Vectorize index using the provided ids. @@ -638,6 +683,8 @@ npx wrangler vectorize delete-vectors [OPTIONS] - `--ids` - List of ids corresponding to the vectors that must be deleted. + + ### `create-metadata-index` Enable metadata filtering on the specified property. @@ -653,6 +700,8 @@ npx wrangler vectorize create-metadata-index [OPTIONS] - `--type` - Data type of the property. Must be one of `string`, `number`, or `boolean`. + + ### `list-metadata-index` List metadata properties on which metadata filtering is enabled. @@ -664,6 +713,8 @@ npx wrangler vectorize list-metadata-index [OPTIONS] - `INDEX_NAME` - The name of the Vectorize index for which metadata indexes needs to be fetched. + + ### `delete-metadata-index` Disable metadata filtering on the specified property. @@ -677,6 +728,8 @@ npx wrangler vectorize delete-metadata-index [OPTIONS] - `--property-name` - Metadata property for which metadata filtering should be disabled. + + --- ## `dev` @@ -774,6 +827,8 @@ As of Wrangler v3.2.0, `wrangler dev` is supported by any Linux distributions pr - `--alias` `Array` - Specify modules to alias using [module aliasing](/workers/wrangler/configuration/#module-aliasing). + + `wrangler dev` is a way to [locally test](/workers/testing/local-development/) your Worker while developing. With `wrangler dev` running, send HTTP requests to `localhost:8787` and your Worker should execute as expected. You will also see `console.log` messages and exceptions appearing in your terminal. --- @@ -848,6 +903,8 @@ None of the options for this command are required. Also, many can be set in your - `--dispatch-namespace` - Specify the [Workers for Platforms dispatch namespace](/cloudflare-for-platforms/workers-for-platforms/get-started/configuration/#2-create-a-dispatch-namespace) to upload this Worker to. + + --- ## `publish` @@ -883,6 +940,8 @@ wrangler delete [