Commands
Namespace Management
wrangler kv namespace create
wrangler kv namespace create
Create a new KV namespace.Options:Example:
The name of the new namespace
Interact with a preview namespace
Environment to use for operations and .env files
Automatically update your wrangler configuration file with the new namespace binding (defaults to interactive prompt)
The name of the binding to use for the namespace in your wrangler configuration file
wrangler kv namespace list
wrangler kv namespace list
Output a list of all KV namespaces associated with your account.Example:Returns JSON array of namespace objects with
id and title properties.wrangler kv namespace delete
wrangler kv namespace delete
Delete a KV namespace.Options:Example:You must specify one of: namespace name,
The name of the namespace to delete
The binding name to the namespace to delete from
The id of the namespace to delete
Interact with a preview namespace
Skip confirmation (alias:
-y)--binding, or --namespace-id.wrangler kv namespace rename
wrangler kv namespace rename
Key Operations
wrangler kv key put
wrangler kv key put
Write a single key/value pair to a namespace.Options:Example:You must provide either
The key to write to
The value to write
The binding name to the namespace to write to
The id of the namespace to write to
Interact with a preview namespace
Read value from the file at a given path
Time for which the entries should be visible (in seconds)
Time since the UNIX epoch after which the entry expires
Arbitrary JSON that is associated with a key
Interact with local storage
Interact with remote storage
Directory for local persistence
--value or --path, and either --binding or --namespace-id.wrangler kv key get
wrangler kv key get
Read a single value by key from a namespace.Options:Example:You must provide either
The key value to get
The binding name to the namespace to get from
The id of the namespace to get from
Interact with a preview namespace
Decode the returned value as a utf8 string
Interact with local storage
Interact with remote storage
Directory for local persistence
--binding or --namespace-id.wrangler kv key list
wrangler kv key list
Output a list of all keys in a namespace.Options:Example:Returns JSON array of key objects.
The binding name to the namespace to list
The id of the namespace to list
Interact with a preview namespace
A prefix to filter listed keys
Interact with local storage
Interact with remote storage
Directory for local persistence
wrangler kv key delete
wrangler kv key delete
Remove a single key value pair from a namespace.Options:Example:
The key value to delete
The binding name to the namespace to delete from
The id of the namespace to delete from
Interact with a preview namespace
Interact with local storage
Interact with remote storage
Directory for local persistence
Bulk Operations
wrangler kv bulk put
wrangler kv bulk put
Upload multiple key-value pairs to a namespace from a JSON file.Options:File format:Example:
The file containing the key/value pairs to write
The binding name to the namespace to write to
The id of the namespace to write to
Interact with a preview namespace
Time for which the entries should be visible
Time since the UNIX epoch after which the entry expires
Arbitrary JSON that is associated with a key
Interact with local storage
Interact with remote storage
Directory for local persistence
wrangler kv bulk get
wrangler kv bulk get
Gets multiple key-value pairs from a namespace.Options:File format:Or with object format:Example:Returns JSON object mapping keys to their values.
The file containing the keys to get
The binding name to the namespace to get from
The id of the namespace to get from
Interact with a preview namespace
Interact with local storage
Interact with remote storage
Directory for local persistence
wrangler kv bulk delete
wrangler kv bulk delete
Delete multiple key-value pairs from a namespace.Options:File format:Or with object format:Example:
The file containing the keys to delete
The binding name to the namespace to delete from
The id of the namespace to delete from
Interact with a preview namespace
Do not ask for confirmation before deleting (alias:
-f)Interact with local storage
Interact with remote storage
Directory for local persistence