Wrangler KV commands
Last updated Apr 21, 2026
kv namespace
Manage Workers KV namespaces.
Note
The kv ... commands allow you to manage your Workers KV resources in the Cloudflare network. Learn more about using Workers KV with Wrangler in the Workers KV guide.
Caution
Since version 3.60.0, Wrangler supports the kv ... syntax. If you are using versions below 3.60.0, the command follows the kv:... syntax. Learn more about the deprecation of the kv:... syntax in the Wrangler commands for KV page.
kv namespace create
Create a new namespace
npmyarnpnpm
npx wrangler kv namespace create <NAMESPACE>
yarn wrangler kv namespace create <NAMESPACE>
pnpm wrangler kv namespace create <NAMESPACE>
<NAMESPACE>stringrequired
The name of the new namespace
- --preview boolean Interact with a preview namespace
- --jurisdiction string The jurisdiction where the new namespace will be created (e.g. "us", "eu", "fedramp")
- --experimental-mode string alias: --x-mode
The storage mode for the new namespace. Instant mode offers lower-latency reads and faster global updates [private beta]. Cannot be combined with --jurisdiction.
- --use-remote boolean Use a remote binding when adding the newly created resource to your config
- --update-config boolean Automatically update your config file with the newly added resource
- --binding string The binding name of this resource in your Worker
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
To restrict where a namespace durably stores data, specify --jurisdiction when creating it. Refer to Data location for supported jurisdictions.
KV Instant namespaces
Note
Workers KV Instant is currently in private beta. To enroll, contact your Cloudflare account team or sign up ↗︎ and tell us about your use case.
To create a Workers KV Instant namespace, pass --experimental-mode instant. This example creates a namespace named APP_CONFIG for small, infrequently updated configuration:
npmyarnpnpm
npx wrangler@latest kv namespace create APP_CONFIG --experimental-mode instant
yarn wrangler@latest kv namespace create APP_CONFIG --experimental-mode instant
pnpm wrangler@latest kv namespace create APP_CONFIG --experimental-mode instant
You can also use the --x-mode instant alias.
kv namespace list
Output a list of all KV namespaces associated with your account id
npmyarnpnpm
npx wrangler kv namespace list
yarn wrangler kv namespace list
pnpm wrangler kv namespace list
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
kv namespace delete
Delete a given namespace.
npmyarnpnpm
npx wrangler kv namespace delete [NAMESPACE]
yarn wrangler kv namespace delete [NAMESPACE]
pnpm wrangler kv namespace delete [NAMESPACE]
[NAMESPACE]stringThe name of the namespace to delete--bindingstringThe binding name to the namespace to delete from--namespace-idstringThe id of the namespace to delete--previewbooleanInteract with a preview namespace--skip-confirmationbooleanalias: --ydefault: false
Skip confirmation
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
kv namespace rename
Rename a KV namespace
npmyarnpnpm
npx wrangler kv namespace rename [OLD-NAME]
yarn wrangler kv namespace rename [OLD-NAME]
pnpm wrangler kv namespace rename [OLD-NAME]
[OLD-NAME]stringThe current name of the namespace to rename--namespace-idstringThe id of the namespace to rename--new-namestringrequired
The new name for the namespace
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
kv key
Manage key-value pairs within a Workers KV namespace.
Note
The kv ... commands allow you to manage your Workers KV resources in the Cloudflare network. Learn more about using Workers KV with Wrangler in the Workers KV guide.
Caution
Since version 3.60.0, Wrangler supports the kv ... syntax. If you are using versions below 3.60.0, the command follows the kv:... syntax. Learn more about the deprecation of the kv:... syntax in the Wrangler commands for KV page.
kv key put
Write a single key/value pair to the given namespace
npmyarnpnpm
npx wrangler kv key put <KEY> [VALUE]
yarn wrangler kv key put <KEY> [VALUE]
pnpm wrangler kv key put <KEY> [VALUE]
<KEY>stringrequired
The key to write to
- [VALUE] string The value to write
- --path string Read value from the file at a given path
- --binding string The binding name to the namespace to write to
- --namespace-id string The id of the namespace to write to
- --preview boolean Interact with a preview namespace
- --ttl number Time for which the entries should be visible
- --expiration number Time since the UNIX epoch after which the entry expires
- --metadata string Arbitrary JSON that is associated with a key
- --local boolean Interact with local storage
- --remote boolean Interact with remote storage
- --persist-to string Directory for local persistence
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
kv key list
Output a list of all keys in a given namespace
npmyarnpnpm
npx wrangler kv key list
yarn wrangler kv key list
pnpm wrangler kv key list
--bindingstringThe binding name to the namespace to list--namespace-idstringThe id of the namespace to list--previewbooleandefault: false
Interact with a preview namespace
- --prefix string A prefix to filter listed keys
- --local boolean Interact with local storage
- --remote boolean Interact with remote storage
- --persist-to string Directory for local persistence
<details>
<summary>
Global flags
</summary>
- <code>--v</code><code>boolean</code> alias: --version
Show version number - <code>--cwd</code><code>string</code>Run as if Wrangler was started in the specified directory instead of the current working directory - <code>--config</code><code>string</code> alias: --c
Path to Wrangler configuration file - <code>--env</code><code>string</code> alias: --e
Environment to use for operations, and for selecting .env and .dev.vars files - <code>--env-file</code><code>string</code>Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files - <code>--install-skills</code><code>boolean</code> default: false
Install Cloudflare skills for detected AI coding agents before running the command - <code>--profile</code><code>string</code>Use a specific auth profile
</details>
kv key get
Read a single value by key from the given namespace
npmyarnpnpm
npx wrangler kv key get <KEY>
