Install the skill above, then run this in your AI tool:
/upstash-redis-kv <your description>
About
Interact with Upstash's Redis-compatible key-value store using the REST interface.
Source
What gets added to your project
Preview every file this package writes on install before you run the command above.
Summary
Read and write to Upstash Redis-compatible key-value store via REST API. ) for the current interact...
Skill instructions
Upstash Redis Key-Value Store
Interact with Upstash's Redis-compatible key-value store using the REST interface.
Script Location
bash
bun run scripts/upstash-client.ts <command> [args...]
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:
bash
bun run scripts/upstash-client.ts --url "https://..." --token "AX..." GET mykey
# 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
List Commands
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
# 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 Set Commands
Sorted sets store members with scores for ranking:
# 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
# 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
Server Commands
bash
PING [message]
ECHO <message>
DBSIZE
TIME
INFO [section]
FLUSHDB # Delete all keys in current DB (DANGEROUS)
FLUSHALL # Delete all keys in all DBs (DANGEROUS)
Command Options
SET Options
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
ZADD Options
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
ZRANGE Options
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)
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:
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/intellectronica/upstash-redis-kv/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@intellectronica/upstash-redis-kv@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: 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 interact...
Run aipm add @intellectronica/upstash-redis-kv@1.0.0 in a project that has AIPM initialized.
Supported tools
@intellectronica/upstash-redis-kv@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.