Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/mkurman-upstash-redis-kv/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 452% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 874% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 265% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 690% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 366% | 0% |
Interact with Upstash's Redis-compatible key-value store using the REST interface.
bashbun run scripts/upstash-client.ts <command> [args...]
IMPORTANT: Always run with bun run, not directly.
The script uses these environment variables by default:
UPSTASH_REDIS_REST_URL - The Upstash REST API URLUPSTASH_REDIS_REST_TOKEN - The Upstash REST API tokenIf the user provides credentials from another source (conversation context, a file, etc.), use the --url and --token flags to override environment variables:
bashbun run scripts/upstash-client.ts --url "https://..." --token "AX..." GET mykey
Priority: Command-line flags > Environment variables
bash# Get/Set GET <key> SET <key> <value> [--ex seconds] [--px ms] [--nx] [--xx] [--keepttl] [--get] SETNX <key> <value> # Set if not exists SETEX <key> <seconds> <value> # Set with expiration # Multiple keys (key/value pairs) MGET <key1> [key2...] MSET <key1> <val1> [key2 val2...] MSETNX <key1> <val1> [key2 val2...] # Set all if none exist # Counters INCR <key> INCRBY <key> <increment> INCRBYFLOAT <key> <increment> DECR <key> DECRBY <key> <decrement> # String manipulation APPEND <key> <value> STRLEN <key> GETRANGE <key> <start> <end> SETRANGE <key> <offset> <value>
Hashes store field-value pairs. Pass fields and values as alternating arguments:
bash# Set hash fields (field/value pairs) HSET <key> <field1> <val1> [field2 val2...] HSETNX <key> <field> <value> # Set field if not exists # Get hash fields HGET <key> <field> HMGET <key> <field1> [field2...] HGETALL <key> # Hash operations HDEL <key> <field1> [field2...] HEXISTS <key> <field> HKEYS <key> HVALS <key> HLEN <key> HINCRBY <key> <field> <increment> HINCRBYFLOAT <key> <field> <increment> HSCAN <key> <cursor> [MATCH pattern] [COUNT count]
Examples:
bash# Store user data bun run scripts/upstash-client.ts HSET user:1 name "John" email "john@example.com" age 30 # Get single field bun run scripts/upstash-client.ts HGET user:1 name # Get all fields bun run scripts/upstash-client.ts HGETALL user:1 # Increment numeric field bun run scripts/upstash-client.ts HINCRBY user:1 age 1
Lists are ordered collections. Values are pushed/popped from left (head) or right (tail):
bash# Push elements LPUSH <key> <val1> [val2...] # Push to head RPUSH <key> <val1> [val2...] # Push to tail LPUSHX <key> <val1> [val2...] # Push if list exists RPUSHX <key> <val1> [val2...] # Pop elements LPOP <key> [count] RPOP <key> [count] # Access elements LRANGE <key> <start> <stop> # Get range (0 = first, -1 = last) LLEN <key> LINDEX <key> <index> # Modify LSET <key> <index> <value> LREM <key> <count> <value> # Remove count occurrences LTRIM <key> <start> <stop> # Keep only range LINSERT <key> <BEFORE|AFTER> <pivot> <value> LPOS <key> <value> LMOVE <src> <dst> <LEFT|RIGHT> <LEFT|RIGHT>
Examples:
bash# Create a task queue bun run scripts/upstash-client.ts RPUSH tasks "task1" "task2" "task3" # Get all tasks bun run scripts/upstash-client.ts LRANGE tasks 0 -1 # Pop task from front (FIFO queue) bun run scripts/upstash-client.ts LPOP tasks # Pop task from back (LIFO stack) bun run scripts/upstash-client.ts RPOP tasks
Sets store unique, unordered members:
bash# Add/remove members SADD <key> <member1> [member2...] SREM <key> <member1> [member2...] # Query SMEMBERS <key> SISMEMBER <key> <member> SMISMEMBER <key> <member1> [member2...] SCARD <key> # Random access SPOP <key> [count] SRANDMEMBER <key> [count] # Set operations SINTER <key1> [key2...] SINTERSTORE <dest> <key1> [key2...] SUNION <key1> [key2...] SUNIONSTORE <dest> <key1> [key2...] SDIFF <key1> [key2...] SDIFFSTORE <dest> <key1> [key2...] SMOVE <src> <dst> <member> SSCAN <key> <cursor> [MATCH pattern] [COUNT count]
Examples:
bash# Add tags bun run scripts/upstash-client.ts SADD article:1:tags "javascript" "redis" "nodejs" # Check membership bun run scripts/upstash-client.ts SISMEMBER article:1:tags "javascript" # Get all members bun run scripts/upstash-client.ts SMEMBERS article:1:tags # Find common tags between articles bun run scripts/upstash-client.ts SINTER article:1:tags article:2:tags
Sorted sets store members with scores for ranking:
bash# Add members (score/member pairs) ZADD <key> <score1> <member1> [score2 member2...] [--nx] [--xx] [--gt] [--lt] [--ch] # Remove ZREM <key> <member1> [member2...] ZREMRANGEBYRANK <key> <start> <stop> ZREMRANGEBYSCORE <key> <min> <max> # Scores and ranks ZSCORE <key> <member> ZMSCORE <key> <member1> [member2...] ZRANK <key> <member> # Rank (low to high) ZREVRANK <key> <member> # Rank (high to low) ZINCRBY <key> <increment> <member> # Range queries ZRANGE <key> <start> <stop> [--withscores] [--rev] [--byscore] [--bylex] ZRANGEBYSCORE <key> <min> <max> [--withscores] [--limit off,count] ZREVRANGE <key> <start> <stop> [--withscores] ZREVRANGEBYSCORE <key> <max> <min> [--withscores] [--limit off,count] # Counting ZCARD <key> ZCOUNT <key> <min> <max> # Pop ZPOPMIN <key> [count] ZPOPMAX <key> [count] # Set operations ZINTERSTORE <dest> <numkeys> <key1> [key2...] ZUNIONSTORE <dest> <numkeys> <key1> [key2...] ZSCAN <key> <cursor> [MATCH pattern] [COUNT count]
Examples:
bash# Create leaderboard (score member pairs) bun run scripts/upstash-client.ts ZADD leaderboard 1000 "player1" 1500 "player2" 1200 "player3" # Get top 3 with scores (highest first) bun run scripts/upstash-client.ts ZRANGE leaderboard 0 2 --rev --withscores # Get player's rank bun run scripts/upstash-client.ts ZREVRANK leaderboard "player2" # Increment player's score bun run scripts/upstash-client.ts ZINCRBY leaderboard 100 "player1" # Get players with scores between 1000 and 1500 bun run scripts/upstash-client.ts ZRANGEBYSCORE leaderboard 1000 1500 --withscores
bash# Delete DEL <key1> [key2...] UNLINK <key1> [key2...] # Async delete # Existence/Type EXISTS <key1> [key2...] TYPE <key> # Expiration EXPIRE <key> <seconds> EXPIREAT <key> <timestamp> PEXPIRE <key> <milliseconds> PEXPIREAT <key> <timestamp> TTL <key> PTTL <key> PERSIST <key> # Remove expiration # Rename RENAME <key> <newkey> RENAMENX <key> <newkey> # Search KEYS <pattern> # Use with caution in production SCAN <cursor> [MATCH pattern] [COUNT count] # Other COPY <src> <dst> DUMP <key> TOUCH <key1> [key2...] RANDOMKEY OBJECT ENCODING|FREQ|IDLETIME|REFCOUNT <key>
Examples:
bash# Set key with 1 hour expiration bun run scripts/upstash-client.ts SET session:abc "data" bun run scripts/upstash-client.ts EXPIRE session:abc 3600 # Or in one command bun run scripts/upstash-client.ts SET session:abc "data" --ex 3600 # Check TTL bun run scripts/upstash-client.ts TTL session:abc # Scan keys matching pattern bun run scripts/upstash-client.ts SCAN 0 MATCH "user:*" COUNT 100
bashPING [message] ECHO <message> DBSIZE TIME INFO [section] FLUSHDB # Delete all keys in current DB (DANGEROUS) FLUSHALL # Delete all keys in all DBs (DANGEROUS)
bash--ex <seconds> # Expire in seconds --px <ms> # Expire in milliseconds --exat <ts> # Expire at Unix timestamp (seconds) --pxat <ts> # Expire at Unix timestamp (ms) --nx # Only set if key does not exist --xx # Only set if key exists --keepttl # Retain existing TTL --get # Return old value
bash--nx # Only add new members --xx # Only update existing members --gt # Only update if new score > current --lt # Only update if new score < current --ch # Return number of changed elements
bash--withscores # Include scores in output --byscore # Range by score instead of rank --bylex # Range by lexicographical order --rev # Reverse order --limit off,count # Limit results (e.g., --limit 0,10)
(nil)Before executing any destructive operation (write, modify, or delete), you MUST ask the user for confirmation. This includes:
Write operations:
Modify operations:
Delete operations:
TTL/Rename operations:
Example confirmation prompt: > "I'm about to HSET user:1 with fields {name: "John", email: "john@example.com"}. Proceed?"
If the user indicates they do not want to be asked for confirmation, respect this for all subsequent operations. Indicators include:
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.
If credentials are missing or invalid, the script will exit with an error message. Ensure the user has configured either:
UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN)--url and --token flags| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-21 | pass→pass | 9,006 | 6,436 | -29% | 1 | 1 | 0% | 1,730 | 4,636 | +168% | 0 | 0 | — |
case-06 | fail→pass | 3,801 | 4,986 | +31% | 1 | 1 | 0% | 676 | 3,734 | +452% | 0 | 0 | — |
case-22 | pass→pass | 8,078 | 6,709 | -17% | 1 | 1 | 0% | 1,517 | 4,707 | +210% | 0 | 0 | — |
case-15 | fail→fail | 2,824 | 4,342 | +54% | 1 | 1 | 0% | 394 | 3,617 | +818% | 0 | 0 | — |
case-01 | fail→fail | 6,628 | 8,227 | +24% | 1 | 1 | 0% | 1,290 | 3,780 | +193% | 0 | 0 | — |
case-02 | fail→pass | 2,483 | 5,109 | +106% | 1 | 1 | 0% | 377 | 3,671 | +874% | 0 | 0 | — |
case-03 | fail→fail | 6,326 | 7,464 | +18% | 1 | 1 | 0% | 1,165 | 3,870 | +232% | 0 | 0 | — |
case-04 | fail→pass | 6,243 | 3,645 | -42% | 1 | 1 | 0% | 1,132 | 4,132 | +265% | 0 | 0 | — |
case-05 | fail→pass | 3,002 | 3,224 | +7% | 1 | 1 | 0% | 497 | 3,925 | +690% | 0 | 0 | — |
case-07 | fail→fail | 3,773 | 2,335 | -38% | 1 | 1 | 0% | 612 | 3,754 | +513% | 0 | 0 | — |
case-08 | fail→pass | 4,451 | 2,324 | -48% | 1 | 1 | 0% | 810 | 3,775 | +366% | 0 | 0 | — |
case-09 | fail→fail | 4,389 | 2,234 | -49% | 1 | 1 | 0% | 710 | 3,741 | +427% | 0 | 0 | — |
case-10 | fail→fail | 1,753 | 4,794 | +173% | 1 | 1 | 0% | 231 | 3,628 | +1471% | 0 | 0 | — |
case-20 | pass→pass | 7,977 | 4,819 | -40% | 1 | 1 | 0% | 1,346 | 4,267 | +217% | 0 | 0 | — |
case-11 | fail→pass | 3,111 | 1,638 | -47% | 1 | 1 | 0% | 486 | 3,650 | +651% | 0 | 0 | — |
case-12 | fail→fail | 2,296 | 4,998 | +118% | 1 | 1 | 0% | 361 | 3,684 | +920% | 0 | 0 | — |
case-13 | fail→fail | 2,762 | 5,854 | +112% | 1 | 1 | 0% | 470 | 3,726 | +693% | 0 | 0 | — |
case-14 | fail→pass | 2,316 | 4,326 | +87% | 1 | 1 | 0% | 377 | 3,635 | +864% | 0 | 0 | — |
case-16 | fail→pass | 3,159 | 2,144 | -32% | 1 | 1 | 0% | 460 | 3,736 | +712% | 0 | 0 | — |
case-17 | fail→fail | 2,491 | 4,975 | +100% | 1 | 1 | 0% | 332 | 3,733 | +1024% | 0 | 0 | — |
case-18 | fail→fail | 4,761 | 1,683 | -65% | 1 | 1 | 0% | 760 | 3,624 | +377% | 0 | 0 | — |
case-19 | fail→pass | 3,291 | 1,406 | -57% | 1 | 1 | 0% | 554 | 3,676 | +564% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 16 counted toward the lift figure. The other 6 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +41 percentage points is the difference between those two pass rates over the 16 comparable cases. 4 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.