Skip to content

CLI

  • Redis / Valkey

The CLI runs one command line at a time, written as you would in redis-cli. As you type, it completes command names and shows the command’s syntax, summary and the arguments that come next, taken from the server’s own command catalog. Replies print in redis-cli format or as raw RESP.

The Redis CLI after HGETALL, TTL, ZREVRANGE and XPENDING commands, with XAUTOCLAIM being typed: its optional COUNT and JUSTID arguments are suggested and its syntax and summary shown below the input.The Redis CLI after HGETALL, TTL, ZREVRANGE and XPENDING commands, with XAUTOCLAIM being typed: its optional COUNT and JUSTID arguments are suggested and its syntax and summary shown below the input.
A CLI that completes commands and their arguments and documents them as you type.
  1. Open the CLI: choose Open CLI from the connection’s menu, Open CLI here on a database, or Tools › CLI.
  2. Type a command, for example HSET cart:1042 sku-oak-chair 2. Suggestions appear as you type; Tab completes the highlighted one.
  3. Read the inline docs under the line: the syntax, a summary with the version it appeared in and its complexity, and Next: the arguments still to type.
  4. Press Enter or choose Run.

↑ and ↓ recall earlier commands; the line you were typing is kept. Commands also go into the query history. Clear empties the output.

The inline docs come from COMMAND DOCS, which Redis 7 and later provide. With an older server only command names complete. A command the server does not know is marked “Unknown command”.

Pick redis-cli for replies formatted as redis-cli prints them, such as (integer) 1, or Raw RESP for the protocol text.

While a MULTI transaction is open, a MULTI badge shows in the toolbar.

Cancel stops a running command by resetting the connection, as redis-cli does; an open MULTI is discarded.

Each command goes to the node that holds its key, and the answering node is shown beside the command. Commands without a key run on the node picked in Keyless commands on.

SUBSCRIBE, PSUBSCRIBE, MONITOR and similar commands are refused in the CLI, with a button to the tool that does their job: Open Pub/Sub or Open Monitor. See Pub/Sub and Monitoring.

Connection What happens
Read-only Commands that write are refused.
Production, or confirm writes Every command that writes asks first (“Run HSET?”).
Any Destructive commands such as FLUSHDB, DEL or CLIENT KILL ask first.

querybara query runs redis-cli style command lines, one per line, against a saved profile or a Redis URI, and prints redis-cli’s output. --format json prints each reply as JSON in one array, and --format jsonl one reply per line.

Terminal window
querybara query "redis://cache.example.com:6379/0" -e 'SET greeting "hello world"'
querybara query "rediss://[email protected]:6380/0" -f commands.txt --format jsonl

SUBSCRIBE, MONITOR and other commands that take over the connection are refused, since querybara query waits for one reply per command. --read-only refuses writes, and destructive commands ask in a terminal or need --yes.

Documents Querybara 0.1.1 · built frombc9f5aa