From a4dd09cb39a8915eea585611805e4d16d5deefa5 Mon Sep 17 00:00:00 2001 From: kodster28 Date: Fri, 29 Aug 2025 10:22:48 -0500 Subject: [PATCH 1/3] [Wrangler] Migrate a few commands to component --- src/components/WranglerCommand.astro | 8 ++- .../components/wrangler-command.mdx | 4 +- .../vectorize/reference/wrangler-commands.mdx | 10 ++- .../docs/workers/wrangler/commands.mdx | 71 ++----------------- .../partials/workers/wrangler-commands/kv.mdx | 6 +- 5 files changed, 20 insertions(+), 79 deletions(-) diff --git a/src/components/WranglerCommand.astro b/src/components/WranglerCommand.astro index 541590d53a5095..97a2cf96f15ffb 100644 --- a/src/components/WranglerCommand.astro +++ b/src/components/WranglerCommand.astro @@ -29,10 +29,11 @@ function getCommand(path: string) { const props = z.object({ command: z.string(), - headingLevel: z.number().default(2) + headingLevel: z.number().default(2), + description: z.string().optional(), }); -let { command, headingLevel } = props.parse(Astro.props); +let { command, headingLevel, description } = props.parse(Astro.props); const definition = getCommand(command); @@ -45,11 +46,12 @@ const { globalFlags } = experimental_getWranglerCommands(); const positionals = definition.positionalArgs ?.map((p) => `[${p.toUpperCase()}]`) .join(" "); - --- +

{description ? description : definition.metadata.description}

+ - The name of the command, i.e `d1 execute`. - `headingLevel` - - The heading level that the command name should be added at on the page, i.e `2` for a `h2`. \ No newline at end of file + - The heading level that the command name should be added at on the page, i.e `2` for a `h2`. +- `description` + - A description to render below the command heading. If not set, defaults to the value specified in the Wrangler help API. \ No newline at end of file diff --git a/src/content/docs/vectorize/reference/wrangler-commands.mdx b/src/content/docs/vectorize/reference/wrangler-commands.mdx index 5e79a90fa2b052..d167ff73db76c1 100644 --- a/src/content/docs/vectorize/reference/wrangler-commands.mdx +++ b/src/content/docs/vectorize/reference/wrangler-commands.mdx @@ -1,8 +1,12 @@ --- -pcx_content_type: navigation title: Wrangler commands -external_link: /workers/wrangler/commands/#vectorize +pcx_content_type: reference sidebar: order: 19 - --- + +import { WranglerNamespace } from "~/components" + +Vectorize uses the following Wrangler Commands. + + \ No newline at end of file diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index 49cdbb968333d9..a376f496b81d94 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -14,6 +14,7 @@ import { Type, MetaInfo, WranglerConfig, + WranglerCommand, WranglerNamespace, PackageManagers, } from "~/components"; @@ -99,36 +100,7 @@ You can then run them using your package manager of choice: --- -## `docs` - -Open the Cloudflare developer documentation in your default browser. - -```txt -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` - -Create a new project via the [create-cloudflare-cli (C3) tool](/workers/get-started/guide/#1-create-a-new-worker-project). A variety of web frameworks are available to choose from as well as templates. Dependencies are installed by default, with the option to deploy your project immediately. - -```txt -wrangler init [] [OPTIONS] -``` - -- `NAME` - - The name of the Workers project. This is both the directory name and `name` property in the generated [Wrangler configuration](/workers/wrangler/configuration/). -- `--yes` - - Answer yes to any prompts for new projects. -- `--from-dash` - - 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. - - + --- @@ -898,34 +870,7 @@ wrangler workflows trigger [OPTIONS] wrangler workflows trigger my-workflow '{"hello":"world"}' ``` -## `tail` - -Start a session to livestream logs from a deployed Worker. - -```txt -wrangler tail [OPTIONS] -``` - -- `WORKER` - - The name of your Worker or the route the Worker is running on. -- `--format` - - The format of the log entries. -- `--status` - - Filter by invocation status. -- `--header` - - Filter by HTTP header. -- `--method` - - Filter by HTTP method. -- `--sampling-rate` - - Add a fraction of requests to log sampling rate (between `0` and `1`). -- `--search` - - Filter by a text match in `console.log` messages. -- `--ip` " - - Filter by the IP address the request originates from. Use `"self"` to show only messages from your own IP. -- `--version-id` - - Filter by Worker version. - - + After starting `wrangler tail`, you will receive a live feed of console and exception logs for each request your Worker receives. @@ -1299,15 +1244,7 @@ If you are using `CLOUDFLARE_API_TOKEN` instead of OAuth, and you can logout by --- -## `whoami` - -Retrieve your user information and test your authentication configuration. - -```txt -wrangler whoami -``` - - + --- diff --git a/src/content/partials/workers/wrangler-commands/kv.mdx b/src/content/partials/workers/wrangler-commands/kv.mdx index 1f711aa1cc5630..73a0780c46fb6b 100644 --- a/src/content/partials/workers/wrangler-commands/kv.mdx +++ b/src/content/partials/workers/wrangler-commands/kv.mdx @@ -62,8 +62,4 @@ Since version 3.60.0, Wrangler supports the `kv ...` syntax. If you are using ve - - -## Global flags - - \ No newline at end of file + \ No newline at end of file From 8ffa617b5d5c18f8144aaa26c7a7392747b87a7b Mon Sep 17 00:00:00 2001 From: kodster28 Date: Fri, 29 Aug 2025 10:25:04 -0500 Subject: [PATCH 2/3] re-add init --- .../docs/workers/wrangler/commands.mdx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index a376f496b81d94..1a08fcd5d65b75 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -104,6 +104,26 @@ You can then run them using your package manager of choice: --- +## `init` + +Create a new project via the [create-cloudflare-cli (C3) tool](/workers/get-started/guide/#1-create-a-new-worker-project). A variety of web frameworks are available to choose from as well as templates. Dependencies are installed by default, with the option to deploy your project immediately. + +```txt +wrangler init [] [OPTIONS] +``` + +- `NAME` + - The name of the Workers project. This is both the directory name and `name` property in the generated [Wrangler configuration](/workers/wrangler/configuration/). +- `--yes` + - Answer yes to any prompts for new projects. +- `--from-dash` + - 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. + + + +--- + ## `containers` Interact with Cloudflare's Container Platform. From 168cbfc338fa3ac6a4b2389187ecd4f01dab36f4 Mon Sep 17 00:00:00 2001 From: kodster28 Date: Fri, 29 Aug 2025 10:47:32 -0500 Subject: [PATCH 3/3] remove the vectorize page since we're not replacing yet --- .../docs/vectorize/reference/wrangler-commands.mdx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/content/docs/vectorize/reference/wrangler-commands.mdx b/src/content/docs/vectorize/reference/wrangler-commands.mdx index d167ff73db76c1..5e79a90fa2b052 100644 --- a/src/content/docs/vectorize/reference/wrangler-commands.mdx +++ b/src/content/docs/vectorize/reference/wrangler-commands.mdx @@ -1,12 +1,8 @@ --- +pcx_content_type: navigation title: Wrangler commands -pcx_content_type: reference +external_link: /workers/wrangler/commands/#vectorize sidebar: order: 19 ---- - -import { WranglerNamespace } from "~/components" -Vectorize uses the following Wrangler Commands. - - \ No newline at end of file +---