Skill

Query, inspect, and manage Redis databases from command line

Reference and safety guide for redis-cli, covering connection, data-type queries, SCAN-based key inspection, monitoring and admin.

Works with redisdocker

88
Spark score
out of 100
Updated 27 days ago
Source checked Oct 14, 2026
Version 19.6.0

Add to Favorites

Why it matters

Interact with Redis databases through a command-line interface to read, write, debug, and monitor key-value data, perform production-safe keyspace scanning, and analyze server performance without blocking operations.

Outcomes

What it gets done

01

Execute Redis commands in interactive or one-shot mode with connection options for TLS, authentication, and database selection

02

Scan and filter keys using production-safe SCAN operations with pattern matching instead of blocking KEYS commands

03

Inspect server health, memory usage, keyspace statistics, and latency metrics using INFO and analysis modes

04

Query and manipulate data structures including strings, hashes, lists, sets, and sorted sets with type-specific operations

Install

Add it to your toolbox

Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-redis-cli | bash

After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.

Reports

Agent outcome reports

No reports yet

Overview

A command-line reference and safety guide for redis-cli, covering connection options, every core data-type query, production-safe SCAN-based key inspection, latency and memory analysis, and server administration. Use it whenever the user mentions redis-cli or needs to query, inspect, debug or manage Redis from the command line; avoid KEYS * on large databases and never pass a password via -a in production.

What it does

Acts as a command-line reference and usage guide for redis-cli, the primary tool for interacting with Redis, supporting command-line execution (run one command and exit) and interactive REPL mode with tab completion, history and hints, plus special modes for monitoring, latency analysis, keyspace scanning, and data import/export. It fires whenever the user mentions redis-cli or a task involving querying, inspecting, debugging or managing Redis from the command line, including key/value reads and writes or SCAN and keyspace work. Official resources are Redis's own CLI docs, commands reference, and download page.

Install options cover Homebrew on macOS, apt install redis-tools on Ubuntu/Debian, yum install redis on CentOS/RHEL, apk add redis on Alpine, building the binary from source at src/redis-cli, or running it via Docker with no install at all.

Security guidance is explicit: never pass a password via -a in production since it's visible in shell history and process listings, using the REDISCLI_AUTH environment variable instead; KEYS * blocks the server on large databases, so production code should always use SCAN; MONITOR logs every command including sensitive data, so it should be used cautiously and never for extended periods on production; FLUSHALL/FLUSHDB are irreversible, so the target database should be verified with CLIENT LIST or INFO keyspace first; and an --rdb transfer during active writes on a busy server may produce an inconsistent snapshot.

Connection options cover the default 127.0.0.1:6379, explicit host/port, password auth (preferring the environment variable over -a), a full redis://user:password@host:port/dbnum URI, TLS via --tls --cacert, selecting a database with -n, and IPv4/IPv6 preference with -4/-6. In interactive mode the prompt shows host:port[db], and CONNECT <host> <port> switches instances without leaving the session.

A data query cheat sheet covers every core type with its complexity: string operations (GET, SET with NX/XX/EX/PX/KEEPTTL conditions, MGET, INCR/INCRBY, STRLEN, GETRANGE, all O(1) except substring ops); hash operations (HGET, HMGET, HGETALL, HKEYS, HLEN, HEXISTS, HSCAN for iteration); list operations (LRANGE, LLEN, LINDEX, LPOS); set operations (SMEMBERS, SCARD, SISMEMBER, SMISMEMBER, SSCAN); sorted-set operations (ZRANGE by index, score range or lexicographic range, ZCARD, ZSCORE, ZRANK, ZSCAN); and key inspection (EXISTS, TYPE, TTL/PTTL, MEMORY USAGE, OBJECT ENCODING, OBJECT IDLETIME, DBSIZE, RANDOMKEY).

Key scanning is production-safe via SCAN-based iteration, which never blocks the server the way KEYS * does, either through redis-cli's built-in --scan mode (with --pattern for glob filtering and --count as a batch-size hint) or programmatically via SCAN 0 MATCH pattern COUNT n, continuing with each returned cursor until it comes back 0. SCAN guarantees a full iteration (cursor 0 back to cursor 0) returns every element that existed for the entire duration, though elements may appear more than once and duplicates need handling in the application.

Server inspection covers real-time stats via --stat, INFO sections for server, memory, keyspace, replication or everything, keyspace analysis via --bigkeys (largest keys by element count), --memkeys (largest by memory), and --keystats (both combined with distribution), and latency analysis via --latency, --latency-history, --latency-dist, and --intrinsic-latency for the system baseline run on the Redis host itself.

Output control covers raw output (default when piping, or forced with --raw), forced human-readable output with --no-raw when piping, CSV output, JSON output (RESP3 by default, -2 for RESP2), reading the last argument from stdin with -x, and piping a file of commands directly into redis-cli. Commands can repeat N times with -r, with an optional delay via -i, or infinitely with -r -1; interactive mode accepts a leading count prefix to repeat a command inline.

Server administration spans ACL management (ACL LIST, SETUSER, DELUSER, DRYRUN to test a permission, GENPASS), client management (CLIENT LIST, KILL, PAUSE, SETNAME), configuration (CONFIG GET/SET/REWRITE/RESETSTAT), replication acknowledgment (WAIT, and WAITAOF for Redis 7.2+ AOF fsync confirmation), persistence (BGSAVE, BGREWRITEAOF, LASTSAVE), replication setup (REPLICAOF host port and REPLICAOF NO ONE to promote to master), server lifecycle (SHUTDOWN SAVE/SHUTDOWN NOSAVE), slow-log inspection (SLOWLOG GET/LEN/RESET), and cluster management (--cluster check, --cluster reshard, and -c for a cluster-aware connection).

Detailed reference material is split across bundled files: references/connection-and-options.md for full connection flags, TLS, environment variables and RESP protocol versions; references/data-query-commands.md for every core data-type command including Streams, Bitmaps, HyperLogLog, Geospatial, Key and Database Operations, and Transactions; references/module-data-types.md for module types like RedisJSON, Vector Sets (Redis 8.0+), Bloom/Cuckoo Filter, Top-K, Count-Min Sketch, T-Digest, TimeSeries, and RediSearch full-text search; references/key-management.md for the SCAN family, big-key analysis, expiration and mass insertion; references/inspection-and-monitoring.md for INFO, MONITOR, latency tools, backups and replica mode; references/advanced-features.md for Lua scripting, Pub/Sub, pipe mode, output formats and cluster subcommands; and references/server-administration.md for ACL, client, config, replication and lifecycle management in depth.

Worked workflows given verbatim include exploring an unknown database (keyspace stats, then big keys and memory, then sampled key types and TTLs, then type-appropriate reads), real-time monitoring (--stat, watching a specific INFO field on a loop, MONITOR with an explicit high-overhead caution, or continuous --latency-history), and querying specific key patterns by counting, iterating and inspecting keys matching a --scan --pattern filter in a shell loop.

When to use - and when NOT to

Use it whenever the user mentions redis-cli or Redis CLI, or needs to query, inspect, debug or manage Redis from the command line, including key/value operations, SCAN-based keyspace work, latency analysis, or server administration. Skip KEYS * on any database that might be large, and never pass a password via -a or run MONITOR for an extended period on production.

Inputs and outputs

Input is a Redis connection target (host, port, database, optional TLS/auth) plus a command or interactive session. Output is command results (values, counts, scan cursors), server stats and INFO sections, latency or memory analysis, or the effect of an administrative operation.

Integrations

Wraps the redis-cli binary against any Redis server or cluster, including module data types like RedisJSON, Vector Sets, and RediSearch, and points to Redis's own official documentation, commands reference, and protocol specification.

Who it's for

Anyone querying, inspecting, debugging, monitoring, or administering a Redis instance from the terminal who wants production-safe patterns like SCAN-based iteration and environment-variable auth instead of ad hoc, unsafe commands.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.