Skip to content
100% local

Redis command builder

Turn a pasted list of keys and values into ready-to-run Redis commands.

Keys and values (one entry per line)
Output

Redis command builder

Paste a list of keys and values, one entry per line, and this tool turns them into Redis commands ready for redis-cli. Pick the data structure — string, hash, list, set or sorted set — and it generates the matching write command for every line: SET for strings, HSET for hashes, RPUSH for lists, SADD for sets and ZADD for sorted sets. It's built for seeding a cache, backfilling a hash from a spreadsheet export, or scripting test data without hand-typing every command.

The options shape how the commands come out. A key prefix is prepended to every key, so a bare list of IDs becomes "user:1", "user:2" and so on. An expiry in seconds adds one EXPIRE per unique key. Batching switches between plain sequential commands, a pipeline header for redis-cli --pipe, and a MULTI/EXEC transaction that runs the batch atomically. Escaping wraps every value in a quoted, backslash-escaped string so spaces and quotes can't break the command — turn it off only when every value is a single plain token.

Each line needs the fields its structure expects: "key value" for strings, lists and sets; "key field value" for hashes; "key score value" for sorted sets, where the score must be numeric. A line with too few fields, or a non-numeric score, is skipped rather than breaking the batch. Output renders as plain redis-cli commands or as raw RESP protocol bytes, and always ends with a SCAN example built from your key prefix — a reminder to traverse large keyspaces with SCAN, not the blocking KEYS.

Everything runs locally in your browser. The keys and values you paste, and the commands generated from them, are never uploaded anywhere. Copy the result, download it as a .txt file, or send it to another tool when you're done.

FAQ

What format should each line of the key/value list use?
One entry per line, fields separated by spaces: "key value" for strings, lists and sets; "key field value" for hashes; "key score value" for sorted sets. Anything after the required fields becomes the value, so values can contain spaces.
Why SCAN instead of KEYS?
KEYS scans the whole keyspace in one blocking call, which can stall a production server. SCAN walks the keyspace in small cursor-based steps instead, so the generated example always uses SCAN with your key prefix as the match pattern.
How does the pipeline option differ from a MULTI transaction?
Pipelining just batches commands into one round trip for speed — each still runs independently. MULTI/EXEC groups them into one atomic transaction: either every command in the block applies, or none do.
What does escaping values actually protect against?
With escaping on, every value is wrapped in double quotes with internal quotes and backslashes escaped, so a value containing spaces or punctuation stays one argument instead of breaking the command into pieces.
Is my data uploaded anywhere?
No. The command list is generated entirely in your browser — nothing you paste is sent to a server or to any Redis instance.