Skip to content

Commit 35b1a2f

Browse files
authored
Rename kv:* commands (#5989)
* rename `kv:*` commands to `kv *` and deprecate the former * add changeset * hide kv:* commands from help text * update snapshots * remove unsued import * add test for `kv --help` snapshot * update all snapshots
1 parent e144f63 commit 35b1a2f

File tree

6 files changed

+284
-147
lines changed

6 files changed

+284
-147
lines changed

.changeset/eleven-cows-marry.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": minor
3+
---
4+
5+
feature: rename `wrangler kv:...` commands to `wrangler kv ...`
6+
7+
The old commands are now deprecated (but still functional) and will be removed in a future release. The new commands are now more consistent with the rest of the wrangler CLI commands.

packages/wrangler/src/__tests__/index.test.ts

+47-51
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ describe("wrangler", () => {
4444
wrangler delete [script] 🗑 Delete your Worker from Cloudflare.
4545
wrangler tail [worker] 🦚 Starts a log tailing session for a published Worker.
4646
wrangler secret 🤫 Generate a secret that can be referenced in a Worker
47-
wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
48-
wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
49-
wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
47+
wrangler kv 🗂️ Interact with your Workers KV Namespaces
5048
wrangler pages ⚡️ Configure Cloudflare Pages
5149
wrangler queues 🇶 Configure Workers Queues
5250
wrangler r2 📦 Interact with an R2 store
@@ -97,9 +95,7 @@ describe("wrangler", () => {
9795
wrangler delete [script] 🗑 Delete your Worker from Cloudflare.
9896
wrangler tail [worker] 🦚 Starts a log tailing session for a published Worker.
9997
wrangler secret 🤫 Generate a secret that can be referenced in a Worker
100-
wrangler kv:namespace 🗂️ Interact with your Workers KV Namespaces
101-
wrangler kv:key 🔑 Individually manage Workers KV key-value pairs
102-
wrangler kv:bulk 💪 Interact with multiple Workers KV key-value pairs at once
98+
wrangler kv 🗂️ Interact with your Workers KV Namespaces
10399
wrangler pages ⚡️ Configure Cloudflare Pages
104100
wrangler queues 🇶 Configure Workers Queues
105101
wrangler r2 📦 Interact with an R2 store
@@ -175,70 +171,70 @@ describe("wrangler", () => {
175171
`);
176172
});
177173

178-
it("no subcommand 'kv:namespace' should display a list of available subcommands", async () => {
179-
await runWrangler("kv:namespace");
174+
it("no subcommand 'kv namespace' should display a list of available subcommands", async () => {
175+
await runWrangler("kv namespace");
180176
await endEventLoop();
181177
expect(std.out).toMatchInlineSnapshot(`
182-
"wrangler kv:namespace
178+
"wrangler kv namespace
183179
184-
🗂️ Interact with your Workers KV Namespaces
180+
🗂️ Interact with your Workers KV Namespaces
185181
186-
Commands:
187-
wrangler kv:namespace create <namespace> Create a new namespace
188-
wrangler kv:namespace list Outputs a list of all KV namespaces associated with your account id.
189-
wrangler kv:namespace delete Deletes a given namespace.
182+
Commands:
183+
wrangler kv namespace create <namespace> Create a new namespace
184+
wrangler kv namespace list Outputs a list of all KV namespaces associated with your account id.
185+
wrangler kv namespace delete Deletes a given namespace.
190186
191-
Flags:
192-
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
193-
-c, --config Path to .toml configuration file [string]
194-
-e, --env Environment to use for operations and .env files [string]
195-
-h, --help Show help [boolean]
196-
-v, --version Show version number [boolean]"
197-
`);
187+
Flags:
188+
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
189+
-c, --config Path to .toml configuration file [string]
190+
-e, --env Environment to use for operations and .env files [string]
191+
-h, --help Show help [boolean]
192+
-v, --version Show version number [boolean]"
193+
`);
198194
});
199195

200-
it("no subcommand 'kv:key' should display a list of available subcommands", async () => {
201-
await runWrangler("kv:key");
196+
it("no subcommand 'kv key' should display a list of available subcommands", async () => {
197+
await runWrangler("kv key");
202198
await endEventLoop();
203199
expect(std.out).toMatchInlineSnapshot(`
204-
"wrangler kv:key
200+
"wrangler kv key
205201
206-
🔑 Individually manage Workers KV key-value pairs
202+
🔑 Individually manage Workers KV key-value pairs
207203
208-
Commands:
209-
wrangler kv:key put <key> [value] Writes a single key/value pair to the given namespace.
210-
wrangler kv:key list Outputs a list of all keys in a given namespace.
211-
wrangler kv:key get <key> Reads a single value by key from the given namespace.
212-
wrangler kv:key delete <key> Removes a single key value pair from the given namespace.
204+
Commands:
205+
wrangler kv key put <key> [value] Writes a single key/value pair to the given namespace.
206+
wrangler kv key list Outputs a list of all keys in a given namespace.
207+
wrangler kv key get <key> Reads a single value by key from the given namespace.
208+
wrangler kv key delete <key> Removes a single key value pair from the given namespace.
213209
214-
Flags:
215-
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
216-
-c, --config Path to .toml configuration file [string]
217-
-e, --env Environment to use for operations and .env files [string]
218-
-h, --help Show help [boolean]
219-
-v, --version Show version number [boolean]"
220-
`);
210+
Flags:
211+
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
212+
-c, --config Path to .toml configuration file [string]
213+
-e, --env Environment to use for operations and .env files [string]
214+
-h, --help Show help [boolean]
215+
-v, --version Show version number [boolean]"
216+
`);
221217
});
222218

223-
it("no subcommand 'kv:bulk' should display a list of available subcommands", async () => {
224-
await runWrangler("kv:bulk");
219+
it("no subcommand 'kv bulk' should display a list of available subcommands", async () => {
220+
await runWrangler("kv bulk");
225221
await endEventLoop();
226222
expect(std.out).toMatchInlineSnapshot(`
227-
"wrangler kv:bulk
223+
"wrangler kv bulk
228224
229-
💪 Interact with multiple Workers KV key-value pairs at once
225+
💪 Interact with multiple Workers KV key-value pairs at once
230226
231-
Commands:
232-
wrangler kv:bulk put <filename> Upload multiple key-value pairs to a namespace
233-
wrangler kv:bulk delete <filename> Delete multiple key-value pairs from a namespace
227+
Commands:
228+
wrangler kv bulk put <filename> Upload multiple key-value pairs to a namespace
229+
wrangler kv bulk delete <filename> Delete multiple key-value pairs from a namespace
234230
235-
Flags:
236-
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
237-
-c, --config Path to .toml configuration file [string]
238-
-e, --env Environment to use for operations and .env files [string]
239-
-h, --help Show help [boolean]
240-
-v, --version Show version number [boolean]"
241-
`);
231+
Flags:
232+
-j, --experimental-json-config Experimental: Support wrangler.json [boolean]
233+
-c, --config Path to .toml configuration file [string]
234+
-e, --env Environment to use for operations and .env files [string]
235+
-h, --help Show help [boolean]
236+
-v, --version Show version number [boolean]"
237+
`);
242238
});
243239

244240
it("no subcommand 'r2' should display a list of available subcommands", async () => {

0 commit comments

Comments
 (0)