upstash-redis-kv

Read and write to Upstash Redis-compatible key-value store via REST API. Use when there is a need to save or retrieve key-value data, use Redis features (caching, counters, lists, sets, hashes, sorted sets, etc.) for the current interaction, or when the user explicitly asks to use Upstash or Redis.

By intellectronica · 460 installs

npx skills add intellectronica/agent-skills --skill upstash-redis-kv

Source repository · Upstream listing

Upstash Redis Key Value Store Interact with Upstash's Redis compatible key value store using the REST interface. Script Location IMPORTANT : Always run with bun run , not directly. Configuration Environment Variables The script uses these environment variables by default: UPSTASH REDIS REST URL The Upstash REST API URL UPSTASH REDIS REST TOKEN The Upstash REST API token Overriding Credentials If the user provides credentials from another source (conversation context, a file, etc.), use the url and token flags to override environment variables: Priority : Command line flags Environment variables Command Reference String Commands Hash Commands Hashes store field value pairs. Pass fields and values as alternating arguments: Examples: List Commands Lists are ordered collections. Values are pushed/popped from left (head) or right (tail): Examples: Set Commands Sets store unique, unordered members: Examples: Sorted Set Commands Sorted sets store members with scores for ranking: Examples: Key Commands Examples: Server Commands Command Options SET Options ZADD Options ZRANGE Options Output Format String values : Printed directly null/nil : Prints (nil) Objects/arrays : Pretty printed as JSON Confirmation Behaviour Default: Ask for Confirmation Before executing any destructive operation (write, modify, or delete), you MUST ask the user for confirmation. This includes: Write operations: SET, SETNX, SETEX, PSETEX, MSET, MSETNX HSET, HSETNX LPUSH, RPUSH, LPUSHX, RPUSHX, LSET, LINSERT SADD ZADD Modify operations: INCR, INCRBY, INCRBYFLOAT, DECR, DECRBY APPEND, SETRANGE HINCRBY, HINCRBYFLOAT LREM, LTRIM, LMOVE ZINCRBY Delete operations: DEL, UNLINK HDEL LPOP, RPOP SREM, SPOP, SMOVE ZREM, ZREMRANGEBYRANK, ZREMRANGEBYSCORE, ZPOPMIN, ZPOPMAX FLUSHDB, FLUSHALL (extra caution) TTL/Rename operations: EXPIRE, EXPIREAT, PEXPIRE, PEXPIREAT, PERSIST RENAME, RENAMENX Example confirmation prompt: "I'm about to HSET user:1 with fields {name: "John", email: "john@example.com"} . Proceed?" YOLO Mode: Skip Confirmation If the user indicates they do not want to be asked for confirmation, respect this for all subsequent operations. Indicators include: "YOLO mode" "Don't ask for confirmation" "You're free to make changes without asking" "Just do it" "No need to confirm" "Auto approve" or "auto confirm" Any similar phrasing indicating blanket approval Once YOLO mode is activated, proceed with destructive operations without asking, but still inform the user what was done. Example: Set user:1 with {name: "John", email: "john@example.com"} done. Error Handling If credentials are missing or invalid, the script will exit with an error message. Ensure the user has configured either: 1. Environment variables ( UPSTASH REDIS REST URL , UPSTASH REDIS REST TOKEN ) 2. Or provides credentials via url and token flags When to Use This Skill User explicitly asks to store or retrieve data from Upstash/Redis Need to persist data across conversations or sessions Implementing caching for expensive operations Maintaining counters, rate limits, or statistics Storing user preferences or session data Building leaderboards or rankings (sorted sets) Managing queues or task lists (lists) Tagging or categorisation (sets) Storing structured objects (hashes) Any scenario requiring fast key value storage