Wrangler KV commands
Manage Workers KV namespaces.
npx wrangler kv namespace create [NAMESPACE]
pnpm wrangler kv namespace create [NAMESPACE]
yarn wrangler kv namespace create [NAMESPACE]
-
--namespace
string requiredThe name of the new namespace
-
--preview
booleanInteract with a preview namespace
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv namespace list
pnpm wrangler kv namespace list
yarn wrangler kv namespace list
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv namespace delete
pnpm wrangler kv namespace delete
yarn wrangler kv namespace delete
-
--binding
stringThe binding name to the namespace to delete from
-
--namespace-id
stringThe id of the namespace to delete
-
--preview
booleanInteract with a preview namespace
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv namespace rename [OLD-NAME]
pnpm wrangler kv namespace rename [OLD-NAME]
yarn wrangler kv namespace rename [OLD-NAME]
-
--old-name
stringThe current name (title) of the namespace to rename
-
--namespace-id
stringThe id of the namespace to rename
-
--new-name
string requiredThe new name for the namespace
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Manage key-value pairs within a Workers KV namespace.
npx wrangler kv key put [KEY] [VALUE]
pnpm wrangler kv key put [KEY] [VALUE]
yarn wrangler kv key put [KEY] [VALUE]
-
--key
string requiredThe key to write to
-
--value
stringThe value to write
-
--binding
stringThe binding name to the namespace to write to
-
--namespace-id
stringThe id of the namespace to write to
-
--preview
booleanInteract with a preview namespace
-
--ttl
numberTime for which the entries should be visible
-
--expiration
numberTime since the UNIX epoch after which the entry expires
-
--metadata
stringArbitrary JSON that is associated with a key
-
--path
stringRead value from the file at a given path
-
--local
booleanInteract with local storage
-
--remote
booleanInteract with remote storage
-
--persist-to
stringDirectory for local persistence
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv key list
pnpm wrangler kv key list
yarn wrangler kv key list
-
--binding
stringThe binding name to the namespace to list
-
--namespace-id
stringThe id of the namespace to list
-
--preview
boolean default: falseInteract with a preview namespace
-
--prefix
stringA prefix to filter listed keys
-
--local
booleanInteract with local storage
-
--remote
booleanInteract with remote storage
-
--persist-to
stringDirectory for local persistence
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv key get [KEY]
pnpm wrangler kv key get [KEY]
yarn wrangler kv key get [KEY]
-
--key
string requiredThe key value to get.
-
--binding
stringThe binding name to the namespace to get from
-
--namespace-id
stringThe id of the namespace to get from
-
--preview
boolean default: falseInteract with a preview namespace
-
--text
boolean default: falseDecode the returned value as a utf8 string
-
--local
booleanInteract with local storage
-
--remote
booleanInteract with remote storage
-
--persist-to
stringDirectory for local persistence
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv key delete [KEY]
pnpm wrangler kv key delete [KEY]
yarn wrangler kv key delete [KEY]
-
--key
string requiredThe key value to delete.
-
--binding
stringThe binding name to the namespace to delete from
-
--namespace-id
stringThe id of the namespace to delete from
-
--preview
booleanInteract with a preview namespace
-
--local
booleanInteract with local storage
-
--remote
booleanInteract with remote storage
-
--persist-to
stringDirectory for local persistence
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
Manage multiple key-value pairs within a Workers KV namespace in batches.
npx wrangler kv bulk get [FILENAME]
pnpm wrangler kv bulk get [FILENAME]
yarn wrangler kv bulk get [FILENAME]
-
--filename
string requiredThe file containing the keys to get
-
--binding
stringThe binding name to the namespace to get from
-
--namespace-id
stringThe id of the namespace to get from
-
--preview
booleanInteract with a preview namespace
-
--local
booleanInteract with local storage
-
--remote
booleanInteract with remote storage
-
--persist-to
stringDirectory for local persistence
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv bulk put [FILENAME]
pnpm wrangler kv bulk put [FILENAME]
yarn wrangler kv bulk put [FILENAME]
-
--filename
string requiredThe file containing the key/value pairs to write
-
--binding
stringThe binding name to the namespace to write to
-
--namespace-id
stringThe id of the namespace to write to
-
--preview
booleanInteract with a preview namespace
-
--ttl
numberTime for which the entries should be visible
-
--expiration
numberTime since the UNIX epoch after which the entry expires
-
--metadata
stringArbitrary JSON that is associated with a key
-
--local
booleanInteract with local storage
-
--remote
booleanInteract with remote storage
-
--persist-to
stringDirectory for local persistence
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
npx wrangler kv bulk delete [FILENAME]
pnpm wrangler kv bulk delete [FILENAME]
yarn wrangler kv bulk delete [FILENAME]
-
--filename
string requiredThe file containing the keys to delete
-
--binding
stringThe binding name to the namespace to delete from
-
--namespace-id
stringThe id of the namespace to delete from
-
--preview
booleanInteract with a preview namespace
-
--force
boolean alias: --fDo not ask for confirmation before deleting
-
--local
booleanInteract with local storage
-
--remote
booleanInteract with remote storage
-
--persist-to
stringDirectory for local persistence
Global flags
-
--v
boolean alias: --versionShow version number
-
--cwd
stringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--config
string alias: --cPath to Wrangler configuration file
-
--env
string alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-file
stringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-remote-bindings
boolean aliases: --x-remote-bindingsExperimental: Enable Remote Bindings
-
--experimental-provision
boolean aliases: --x-provisionExperimental: Enable automatic resource provisioning
The following global flags work on every command:
--help
boolean- Show help.
--config
string (not supported by Pages)- Path to your Wrangler configuration file.
--cwd
string- Run as if Wrangler was started in the specified directory instead of the current working directory.
Below are deprecations to Wrangler commands for Workers KV.
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.
The kv:...
syntax is deprecated in versions 3.60.0 and beyond and will be removed in a future major version.
For example, commands using the kv ...
syntax look as such:
wrangler kv namespace listwrangler kv key get <KEY>wrangler kv bulk put <FILENAME>
The same commands using the kv:...
syntax look as such:
wrangler kv:namespace listwrangler kv:key get <KEY>wrangler kv:bulk put <FILENAME>
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark