Redis data structures and commands including strings, lists, hashes, sets, sorted sets, streams, and transactions for high-performance caching and real-time applications.
Provides Redis commands for strings, lists, hashes, sets, sorted sets, and transactions. Use when the user needs to interact with Redis for caching, real-time apps, or data structures.
/plugin marketplace add pluginagentmarketplace/custom-plugin-sql/plugin install custom-plugin-sql@pluginagentmarketplace-sqlThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlpatterns.mdreferences/GUIDE.mdscripts/helper.py# Start Redis server
redis-server
# Connect to Redis CLI
redis-cli
# Test connection
ping # Returns "PONG"
# Select database
SELECT 0 # Default database
SELECT 1 # Database 1
// SET and GET
SET key value
SET user:1:name "John Doe"
GET user:1:name
// SET with options
SET key value EX 3600 // Expire in 3600 seconds
SET key value PX 3600000 // Expire in milliseconds
SET key value NX // Only if not exists
SET key value XX // Only if exists
// Numeric operations
SET counter 0
INCR counter // Increment by 1
INCRBY counter 5 // Increment by N
DECR counter // Decrement by 1
DECRBY counter 3 // Decrement by N
INCRBYFLOAT counter 2.5 // Increment by float
// String operations
APPEND key " suffix" // Append to string
STRLEN key // Get length
GETRANGE key 0 3 // Get substring
SETRANGE key 0 "new" // Set substring
// Multiple keys
MSET key1 val1 key2 val2 // Set multiple
MGET key1 key2 // Get multiple
GETSET key newval // Get old value and set new
// Push operations
LPUSH list value1 value2 // Push to left
RPUSH list value1 value2 // Push to right
LPUSHX list value // Push only if exists
RPUSHX list value // Push only if exists
// Pop operations
LPOP list // Remove and get from left
RPOP list // Remove and get from right
LPOP list 2 // Pop multiple (Redis 6.2+)
// List queries
LRANGE list 0 -1 // Get all elements
LRANGE list 0 2 // Get first 3 elements
LINDEX list 1 // Get element at index
LLEN list // Get list length
LSET list 0 newvalue // Set element at index
// Blocking operations
BLPOP list1 list2 10 // Block until pop or timeout
BRPOP list1 list2 10 // Block until right pop
BRPOPLPUSH src dst 10 // Block, pop right, push left
// Trimming
LTRIM list 0 2 // Keep only first 3 elements
// SET and GET
HSET hash field value // Set single field
HSET hash f1 v1 f2 v2 // Set multiple fields
HGET hash field // Get field value
HGETALL hash // Get all fields and values
// Existence and length
HEXISTS hash field // Check field exists
HLEN hash // Number of fields
HKEYS hash // Get all field names
HVALS hash // Get all values
HSTRLEN hash field // Get value length
// Update operations
HINCRBY hash field 5 // Increment numeric field
HINCRBYFLOAT hash field 2.5 // Increment by float
HSETNX hash field value // Set only if not exists
// Delete
HDEL hash field1 field2 // Delete fields
// Add and remove
SADD set member1 member2 // Add members
SREM set member1 member2 // Remove members
SISMEMBER set member // Check membership
SMEMBERS set // Get all members
SCARD set // Count members
// Set operations
SINTER set1 set2 // Intersection
SUNION set1 set2 // Union
SDIFF set1 set2 // Difference
SINTERSTORE dest s1 s2 // Store intersection result
SUNIONSTORE dest s1 s2 // Store union result
SDIFFSTORE dest s1 s2 // Store difference result
// Pop operations
SPOP set // Remove and return random member
SPOP set 2 // Remove and return N members
SRANDMEMBER set // Get random member without removing
SRANDMEMBER set 3 // Get N random members
// Add and remove
ZADD zset 1 member1 2 member2 // Add with scores
ZREM zset member1 // Remove members
ZCARD zset // Count members
ZSCORE zset member // Get score
// Range queries by score
ZRANGE zset 0 -1 // Get all by index
ZRANGE zset 0 -1 WITHSCORES // With scores
ZREVRANGE zset 0 -1 // Reverse order
ZREVRANGE zset 0 -1 WITHSCORES // Reverse with scores
ZRANGEBYSCORE zset 10 50 // Get by score range
ZRANGEBYSCORE zset -inf +inf // All scores
ZRANGEBYSCORE zset 10 50 LIMIT 0 5 // Pagination
// Score operations
ZINCRBY zset 5 member // Increment score
ZCOUNT zset 10 50 // Count in score range
// Rank queries
ZRANK zset member // Get rank (0-based)
ZREVRANK zset member // Get reverse rank
// Key management
KEYS pattern // Find keys matching pattern
EXISTS key1 key2 // Check key existence
DEL key1 key2 // Delete keys
UNLINK key1 key2 // Async delete
TYPE key // Get key type
// Expiration
EXPIRE key 3600 // Set expiration (seconds)
PEXPIRE key 3600000 // Set expiration (milliseconds)
TTL key // Get TTL (seconds)
PTTL key // Get TTL (milliseconds)
PERSIST key // Remove expiration
// Renaming
RENAME oldkey newkey // Rename key
RENAMENX oldkey newkey // Rename only if new doesn't exist
// Transaction execution
MULTI // Start transaction
SET key1 value1
INCR key2
GET key3
EXEC // Execute all commands atomically
// Discard transaction
MULTI
SET key value
DISCARD // Cancel transaction
// Watch keys
WATCH key1 key2 // Monitor keys for changes
MULTI
SET key1 newvalue
EXEC // Fails if keys changed
// Publisher
PUBLISH channel "message" // Publish to channel
// Subscriber
SUBSCRIBE channel1 channel2 // Subscribe to channels
PSUBSCRIBE pattern* // Subscribe to pattern
UNSUBSCRIBE channel // Unsubscribe
PUNSUBSCRIBE pattern // Unsubscribe from pattern
// Query subscriptions
PUBSUB CHANNELS // Active channels
PUBSUB NUMSUB ch1 ch2 // Subscribers per channel
PUBSUB NUMPAT // Pattern subscriptions count
DBSIZE // Total keys in DB
FLUSHDB // Clear current DB
FLUSHALL // Clear all DBs
SAVE // Synchronous save
BGSAVE // Background save
LASTSAVE // Last save time
INFO // Server statistics
CONFIG GET parameter // Get config value
CONFIG SET parameter value // Set config value
Learn Redis patterns for caching, sessions, rate limiting, and real-time applications in the redis-patterns skill.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.