Manage Workers KV using Wrangler.
Manage Workers KV namespaces.
kv namespace create
Create a new namespace
npx wrangler kv namespace create [NAMESPACE]yarn wrangler kv namespace create [NAMESPACE]pnpm wrangler kv namespace create [NAMESPACE][NAMESPACE]stringrequiredThe name of the new namespace
--previewbooleanInteract with a preview namespace
--use-remotebooleanUse a remote binding when adding the newly created resource to your config
--update-configbooleanAutomatically update your config file with the newly added resource
--bindingstringThe binding name of this resource in your Worker
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv namespace list
Output a list of all KV namespaces associated with your account id
npx wrangler kv namespace listyarn wrangler kv namespace listpnpm wrangler kv namespace listGlobal flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv namespace delete
Delete a given namespace.
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: falseSkip confirmation
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv namespace rename
Rename a KV namespace
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-namestringrequiredThe new name for the namespace
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
Manage key-value pairs within a Workers KV namespace.
kv key put
Write a single key/value pair to the given namespace
npx wrangler kv key put [KEY] [VALUE]yarn wrangler kv key put [KEY] [VALUE]pnpm wrangler kv key put [KEY] [VALUE][KEY]stringrequiredThe key to write to
[VALUE]stringThe value to write
--pathstringRead value from the file at a given path
--bindingstringThe binding name to the namespace to write to
--namespace-idstringThe id of the namespace to write to
--previewbooleanInteract with a preview namespace
--ttlnumberTime for which the entries should be visible
--expirationnumberTime since the UNIX epoch after which the entry expires
--metadatastringArbitrary JSON that is associated with a key
--localbooleanInteract with local storage
--remotebooleanInteract with remote storage
--persist-tostringDirectory for local persistence
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv key list
Output a list of all keys in a given namespace
npx wrangler kv key listyarn wrangler kv key listpnpm wrangler kv key list--bindingstringThe binding name to the namespace to list
--namespace-idstringThe id of the namespace to list
--previewbooleandefault: falseInteract with a preview namespace
--prefixstringA prefix to filter listed keys
--localbooleanInteract with local storage
--remotebooleanInteract with remote storage
--persist-tostringDirectory for local persistence
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv key get
Read a single value by key from the given namespace
npx wrangler kv key get [KEY]yarn wrangler kv key get [KEY]pnpm wrangler kv key get [KEY][KEY]stringrequiredThe key value to get.
--textbooleandefault: falseDecode the returned value as a utf8 string
--bindingstringThe binding name to the namespace to get from
--namespace-idstringThe id of the namespace to get from
--previewbooleandefault: falseInteract with a preview namespace
--localbooleanInteract with local storage
--remotebooleanInteract with remote storage
--persist-tostringDirectory for local persistence
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv key delete
Remove a single key value pair from the given namespace
npx wrangler kv key delete [KEY]yarn wrangler kv key delete [KEY]pnpm wrangler kv key delete [KEY][KEY]stringrequiredThe key value to delete.
--bindingstringThe binding name to the namespace to delete from
--namespace-idstringThe id of the namespace to delete from
--previewbooleanInteract with a preview namespace
--localbooleanInteract with local storage
--remotebooleanInteract with remote storage
--persist-tostringDirectory for local persistence
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
Manage multiple key-value pairs within a Workers KV namespace in batches.
kv bulk get
Gets multiple key-value pairs from a namespace
npx wrangler kv bulk get [FILENAME]yarn wrangler kv bulk get [FILENAME]pnpm wrangler kv bulk get [FILENAME][FILENAME]stringrequiredThe file containing the keys to get
--bindingstringThe binding name to the namespace to get from
--namespace-idstringThe id of the namespace to get from
--previewbooleandefault: falseInteract with a preview namespace
--localbooleanInteract with local storage
--remotebooleanInteract with remote storage
--persist-tostringDirectory for local persistence
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv bulk put
Upload multiple key-value pairs to a namespace
npx wrangler kv bulk put [FILENAME]yarn wrangler kv bulk put [FILENAME]pnpm wrangler kv bulk put [FILENAME][FILENAME]stringrequiredThe file containing the key/value pairs to write
--bindingstringThe binding name to the namespace to write to
--namespace-idstringThe id of the namespace to write to
--previewbooleanInteract with a preview namespace
--ttlnumberTime for which the entries should be visible
--expirationnumberTime since the UNIX epoch after which the entry expires
--metadatastringArbitrary JSON that is associated with a key
--localbooleanInteract with local storage
--remotebooleanInteract with remote storage
--persist-tostringDirectory for local persistence
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile
kv bulk delete
Delete multiple key-value pairs from a namespace
npx wrangler kv bulk delete [FILENAME]yarn wrangler kv bulk delete [FILENAME]pnpm wrangler kv bulk delete [FILENAME][FILENAME]stringrequiredThe file containing the keys to delete
--forcebooleanalias: --fDo not ask for confirmation before deleting
--bindingstringThe binding name to the namespace to delete from
--namespace-idstringThe id of the namespace to delete from
--previewbooleanInteract with a preview namespace
--localbooleanInteract with local storage
--remotebooleanInteract with remote storage
--persist-tostringDirectory for local persistence
Global flags
--vbooleanalias: --versionShow version number
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
--configstringalias: --cPath to Wrangler configuration file
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
--experimental-provisionbooleanaliases: --x-provisiondefault: trueExperimental: Enable automatic resource provisioning
--experimental-auto-createbooleanalias: --x-auto-createdefault: trueAutomatically provision draft bindings with new resources
--install-skillsbooleandefault: falseInstall Cloudflare skills for detected AI coding agents before running the command
--profilestringUse a specific auth profile