| name | redis-cli |
| description | Redis CLI for cache, queues, and in-memory data |
| metadata | {"openclaw":{"always":false,"emoji":"🔴"}} |
Redis CLI
Interface for Redis cache, queues, and in-memory data.
Setup
command -v redis-cli
brew install redis
sudo apt install redis-tools
Connection
redis-cli
redis-cli -h <host> -p <port>
redis-cli -h <host> -p <port> -a <password>
redis-cli -u redis://:<password>@<host>:<port>/<db>
redis-cli ping
Keys
redis-cli KEYS "prefix:*"
redis-cli SCAN 0 MATCH "user:*" COUNT 100
redis-cli TYPE <key>
redis-cli TTL <key>
redis-cli OBJECT ENCODING <key>
redis-cli DEL <key>
redis-cli DEL key1 key2 key3
redis-cli EXPIRE <key> <seconds>
redis-cli PERSIST <key>
Strings
redis-cli SET <key> <value>
redis-cli SET <key> <value> EX 3600
redis-cli GET <key>
redis-cli MGET key1 key2 key3
redis-cli INCR <key>
redis-cli INCRBY <key> 10
Hashes
redis-cli HSET <key> <field> <value>
redis-cli HGET <key> <field>
redis-cli HGETALL <key>
redis-cli HDEL <key> <field>
Lists
redis-cli LPUSH <key> <value>
redis-cli RPUSH <key> <value>
redis-cli LRANGE <key> 0 -1
redis-cli LLEN <key>
Sets
redis-cli SADD <key> <member>
redis-cli SMEMBERS <key>
redis-cli SCARD <key>
redis-cli SISMEMBER <key> <member>
Info and Monitor
redis-cli INFO
redis-cli INFO memory
redis-cli INFO stats
redis-cli INFO keyspace
redis-cli CLIENT LIST
redis-cli MONITOR
redis-cli DBSIZE
redis-cli FLUSHDB
redis-cli FLUSHALL
Tips
- Use
SCAN instead of KEYS in production (non-blocking)
- Use
--pipe for bulk import
- Use
--csv for CSV output
- Use
--bigkeys to find large keys
- Use
--latency to measure latency