Connection
redis-cli
Connect to Redis server on localhost with default port
redis-cli -h -p
Connect to Redis server with specified hostname and port
redis-cli -a
Connect with password
redis-cli -u redis://user:password@host:port
Connect using URI format
Server Information
INFO
Get information and statistics about the server
INFO memory
Get memory-specific information
INFO cpu
Get CPU-specific information
INFO clients
Get connected clients information
INFO stats
Get general statistics
INFO replication
Get replication information
MONITOR
Stream all commands processed by Redis server in real-time
CLIENT LIST
Get information about client connections
Memory Analysis
MEMORY USAGE
Estimate memory usage of a key
MEMORY STATS
Get memory usage details
MEMORY DOCTOR
Output memory problems report
MEMORY PURGE
Attempt to purge dirty pages for memory reclaiming
Performance Metrics
SLOWLOG GET [count]
Get the slow logs (commands that exceeded execution time limits)
SLOWLOG LEN
Get slow log length
SLOWLOG RESET
Clear all slow log entries
LATENCY DOCTOR
Get analysis report about Redis latency
LATENCY HISTORY
Return timestamp-latency samples for the event
Database Inspection
DBSIZE
Return the number of keys in the selected database
KEYS
Find all keys matching the pattern (expensive in production)
SCAN [MATCH pattern] [COUNT count]
Incrementally iterate the keys (preferred over KEYS)
TYPE
Determine the type stored at key
Keyspace Analysis
INFO keyspace
Get statistics about keyspace
RANDOMKEY
Return a random key from the keyspace
TTL
Get the time to live for a key in seconds
PTTL
Get the time to live for a key in milliseconds
Configuration
CONFIG GET
Get the value of a configuration parameter
CONFIG GET *
Get all configuration parameters
CONFIG REWRITE
Rewrite the configuration file with the current configuration