redis
Redis data structures and commands including strings, lists, hashes, sets, sorted sets, streams, and transactions for high-performance caching and real-time applications.
What this skill does
# Redis Data Structures ## Getting Started ```bash # 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 ``` ## String Operations ``` // 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 ``` ## List Operations (Ordered collections) ``` // 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 ``` ## Hash Operations (Maps/objects) ``` // 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 ``` ## Set Operations (Unordered unique values) ``` // 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 ``` ## Sorted Set Operations (Ordered by score) ``` // 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 Operations ``` // 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 ``` ## Transactions & Atomicity ``` // 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 ``` ## Pub/Sub Messaging ``` // 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 ``` ## Server Commands ``` 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 ``` ## Next Steps Learn Redis patterns for caching, sessions, rate limiting, and real-time applications in the `redis-patterns` skill.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.