Skip to content

Commit

Permalink
[Wrangler] Update the commands list (#3735)
Browse files Browse the repository at this point in the history
* Clean up `wrangler --help` output

This commit cleans up and standardizes the look and
of all `wrangler` commands as displayed by
`wrangler --help` and `wrangler <cmd> --help`.

---------

Co-authored-by: Carmen Popoviciu <cpopoviciu@cloudflare.com>
  • Loading branch information
lrapoport-cf and CarmenPopoviciu committed Jun 20, 2024
1 parent 0075621 commit 9c7df38
Show file tree
Hide file tree
Showing 32 changed files with 1,702 additions and 1,649 deletions.
7 changes: 7 additions & 0 deletions .changeset/gorgeous-tomatoes-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

chore: Cleanup `wrangler --help` output

This commit cleans up and standardizes the look and feel of all `wrangler` commands as displayed by `wrangler --help` and `wrangler <cmd> --help`.
52 changes: 27 additions & 25 deletions packages/wrangler/src/__tests__/ai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ describe("ai help", () => {
await endEventLoop();

expect(std.out).toMatchInlineSnapshot(`
"wrangler ai
"wrangler ai
🤖 Interact with AI models
🤖 Manage AI models
Commands:
wrangler ai models List catalog models
wrangler ai finetune Interact with finetune files
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
COMMANDS
wrangler ai models List catalog models
wrangler ai finetune Interact with finetune files
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
});

it("should show help when an invalid argument is passed", async () => {
Expand All @@ -45,22 +46,23 @@ describe("ai help", () => {
"
`);
expect(std.out).toMatchInlineSnapshot(`
"
wrangler ai
"
wrangler ai
🤖 Interact with AI models
🤖 Manage AI models
Commands:
wrangler ai models List catalog models
wrangler ai finetune Interact with finetune files
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
COMMANDS
wrangler ai models List catalog models
wrangler ai finetune Interact with finetune files
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
});
});

Expand Down
40 changes: 20 additions & 20 deletions packages/wrangler/src/__tests__/cloudchamber/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ describe("cloudchamber create", () => {
await runWrangler("cloudchamber create --help");
expect(std.err).toMatchInlineSnapshot(`""`);
expect(std.out).toMatchInlineSnapshot(`
"wrangler cloudchamber create
"wrangler cloudchamber create
Create a new deployment
Create a new deployment
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Options:
--json Return output as clean JSON [boolean] [default: false]
--image Image to use for your deployment [string]
--location Location on Cloudflare's network where your deployment will run [string]
--var Container environment variables [array]
--label Deployment labels [array]
--all-ssh-keys To add all SSH keys configured on your account to be added to this deployment, set this option to true [boolean]
--ssh-key-id ID of the SSH key to add to the deployment [array]
--vcpu Number of vCPUs to allocate to this deployment. [number]
--memory Amount of memory (GB, MB...) to allocate to this deployment. Ex: 4GB. [string]
--ipv4 Include an IPv4 in the deployment [boolean]"
`);
OPTIONS
--json Return output as clean JSON [boolean] [default: false]
--image Image to use for your deployment [string]
--location Location on Cloudflare's network where your deployment will run [string]
--var Container environment variables [array]
--label Deployment labels [array]
--all-ssh-keys To add all SSH keys configured on your account to be added to this deployment, set this option to true [boolean]
--ssh-key-id ID of the SSH key to add to the deployment [array]
--vcpu Number of vCPUs to allocate to this deployment. [number]
--memory Amount of memory (GB, MB...) to allocate to this deployment. Ex: 4GB. [string]
--ipv4 Include an IPv4 in the deployment [boolean]"
`);
});

it("should create deployment (detects no interactivity)", async () => {
Expand Down
26 changes: 13 additions & 13 deletions packages/wrangler/src/__tests__/cloudchamber/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ describe("cloudchamber delete", () => {
await runWrangler("cloudchamber delete --help");
expect(std.err).toMatchInlineSnapshot(`""`);
expect(std.out).toMatchInlineSnapshot(`
"wrangler cloudchamber delete [deploymentId]
"wrangler cloudchamber delete [deploymentId]
Delete an existing deployment that is running in the Cloudflare edge
Delete an existing deployment that is running in the Cloudflare edge
Positionals:
deploymentId deployment you want to delete [string]
POSITIONALS
deploymentId deployment you want to delete [string]
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Options:
--json Return output as clean JSON [boolean] [default: false]"
`);
OPTIONS
--json Return output as clean JSON [boolean] [default: false]"
`);
});

it("should delete deployment (detects no interactivity)", async () => {
Expand Down
28 changes: 14 additions & 14 deletions packages/wrangler/src/__tests__/cloudchamber/images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ describe("cloudchamber image", () => {
await runWrangler("cloudchamber registries --help");
expect(std.err).toMatchInlineSnapshot(`""`);
expect(std.out).toMatchInlineSnapshot(`
"wrangler cloudchamber registries
"wrangler cloudchamber registries
Configure registries via Cloudchamber
Configure registries via Cloudchamber
Commands:
wrangler cloudchamber registries configure Configure Cloudchamber to pull from specific registries
wrangler cloudchamber registries credentials [domain] get a temporary password for a specific domain
COMMANDS
wrangler cloudchamber registries configure Configure Cloudchamber to pull from specific registries
wrangler cloudchamber registries credentials [domain] get a temporary password for a specific domain
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Options:
--json Return output as clean JSON [boolean] [default: false]"
`);
OPTIONS
--json Return output as clean JSON [boolean] [default: false]"
`);
});

it("should create an image registry (no interactivity)", async () => {
Expand Down
38 changes: 19 additions & 19 deletions packages/wrangler/src/__tests__/cloudchamber/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ describe("cloudchamber list", () => {
await runWrangler("cloudchamber list --help");
expect(std.err).toMatchInlineSnapshot(`""`);
expect(std.out).toMatchInlineSnapshot(`
"wrangler cloudchamber list [deploymentIdPrefix]
"wrangler cloudchamber list [deploymentIdPrefix]
List and view status of deployments
List and view status of deployments
Positionals:
deploymentIdPrefix Optional deploymentId to filter deployments
This means that 'list' will only showcase deployments that contain this ID prefix [string]
POSITIONALS
deploymentIdPrefix Optional deploymentId to filter deployments
This means that 'list' will only showcase deployments that contain this ID prefix [string]
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Options:
--json Return output as clean JSON [boolean] [default: false]
--location Filter deployments by location [string]
--image Filter deployments by image [string]
--state Filter deployments by deployment state [string]
--ipv4 Filter deployments by ipv4 address [string]
--label Filter deployments by labels [array]"
`);
OPTIONS
--json Return output as clean JSON [boolean] [default: false]
--location Filter deployments by location [string]
--image Filter deployments by image [string]
--state Filter deployments by deployment state [string]
--ipv4 Filter deployments by ipv4 address [string]
--label Filter deployments by labels [array]"
`);
});

it("should list deployments (json)", async () => {
Expand Down
40 changes: 20 additions & 20 deletions packages/wrangler/src/__tests__/cloudchamber/modify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ describe("cloudchamber modify", () => {
await runWrangler("cloudchamber modify --help");
expect(std.err).toMatchInlineSnapshot(`""`);
expect(std.out).toMatchInlineSnapshot(`
"wrangler cloudchamber modify [deploymentId]
"wrangler cloudchamber modify [deploymentId]
Modify an existing deployment
Modify an existing deployment
Positionals:
deploymentId The deployment you want to modify [string]
POSITIONALS
deploymentId The deployment you want to modify [string]
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Options:
--json Return output as clean JSON [boolean] [default: false]
--var Container environment variables [array]
--label Deployment labels [array]
--ssh-public-key-id Public SSH key IDs to include in this container. You can add one to your account with \`wrangler cloudchamber ssh create [array]
--image The new image that the deployment will have from now on [string]
--location The new location that the deployment will have from now on [string]
--vcpu The new vcpu that the deployment will have from now on [number]
--memory The new memory that the deployment will have from now on [string]"
`);
OPTIONS
--json Return output as clean JSON [boolean] [default: false]
--var Container environment variables [array]
--label Deployment labels [array]
--ssh-public-key-id Public SSH key IDs to include in this container. You can add one to your account with \`wrangler cloudchamber ssh create [array]
--image The new image that the deployment will have from now on [string]
--location The new location that the deployment will have from now on [string]
--vcpu The new vcpu that the deployment will have from now on [number]
--memory The new memory that the deployment will have from now on [string]"
`);
});

it("should modify deployment (detects no interactivity)", async () => {
Expand Down
62 changes: 31 additions & 31 deletions packages/wrangler/src/__tests__/constellation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ describe("constellation help", () => {
await endEventLoop();

expect(std.out).toMatchInlineSnapshot(`
"wrangler constellation
Commands:
wrangler constellation project Manage your projects
wrangler constellation model Manage your models
wrangler constellation catalog Check the curated model catalog
wrangler constellation runtime Check the suported runtimes
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
"wrangler constellation
COMMANDS
wrangler constellation project Manage your projects
wrangler constellation model Manage your models
wrangler constellation catalog Check the curated model catalog
wrangler constellation runtime Check the suported runtimes
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
});

it("should show help when an invalid argument is passed", async () => {
Expand All @@ -47,22 +47,22 @@ describe("constellation help", () => {
"
`);
expect(std.out).toMatchInlineSnapshot(`
"
wrangler constellation
Commands:
wrangler constellation project Manage your projects
wrangler constellation model Manage your models
wrangler constellation catalog Check the curated model catalog
wrangler constellation runtime Check the suported runtimes
Flags:
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
"
wrangler constellation
COMMANDS
wrangler constellation project Manage your projects
wrangler constellation model Manage your models
wrangler constellation catalog Check the curated model catalog
wrangler constellation runtime Check the suported runtimes
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]"
`);
});
});

Expand Down
Loading

0 comments on commit 9c7df38

Please sign in to comment.