Redis
The robomotion redis CLI connects to Redis for key-value and data structure operations. It supports strings (get/set with TTL), hashes (hset/hget/hgetall), lists (push/pop/range), sets (add/remove/members), key management (exists/expire/keys), and pub/sub messaging.
When to use
- Get, set, or delete key-value pairs with optional TTL
- Work with hashes, lists, and sets (full CRUD)
- Publish messages to channels (pub/sub)
- Search keys by pattern, check existence, and manage expiration
Prerequisites
robomotionCLI installed- Package installed:
robomotion install redis - Redis connection credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install redis - Connect with session:
robomotion redis redis_connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion redis redis_set --client-id "<client-id>" --key <key> --value <val> --session-id "<session-id>" --output json - Disconnect when done:
robomotion redis redis_disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion redis redis_connect --session --output jsonConnects to a Redis server and returns a client ID for subsequent operationsrobomotion redis redis_disconnect --client-id --session-id "<session-id>" --output jsonCloses the Redis connection and releases resourcesrobomotion redis redis_get --client-id --key --session-id "<session-id>" --output jsonGets the value of a key from Redisrobomotion redis redis_set --client-id --key --value [--0] --session-id "<session-id>" --output jsonSets a key-value pair in Redis with optional expirationrobomotion redis redis_delete --client-id --key --session-id "<session-id>" --output jsonDeletes one or more keys from Redisrobomotion redis redis_hset --client-id --key --field --value --session-id "<session-id>" --output jsonSets a field in a Redis hashrobomotion redis redis_hget --client-id --key --field --session-id "<session-id>" --output jsonGets a field value from a Redis hashrobomotion redis redis_hgetall --client-id --key --session-id "<session-id>" --output jsonGets all fields and values from a Redis hashrobomotion redis redis_hdel --client-id --key --field --session-id "<session-id>" --output jsonDeletes a field from a Redis hashrobomotion redis redis_lpush --client-id --key --value --session-id "<session-id>" --output jsonPushes a value to the left (head) of a Redis listrobomotion redis redis_rpush --client-id --key --value --session-id "<session-id>" --output jsonPushes a value to the right (tail) of a Redis listrobomotion redis redis_lpop --client-id --key --session-id "<session-id>" --output jsonPops and returns a value from the left (head) of a Redis listrobomotion redis redis_rpop --client-id --key --session-id "<session-id>" --output jsonPops and returns a value from the right (tail) of a Redis listrobomotion redis redis_lrange --client-id --key --0 ---1 --session-id "<session-id>" --output jsonGets a range of elements from a Redis listrobomotion redis redis_llen --client-id --key --session-id "<session-id>" --output jsonGets the length of a Redis listrobomotion redis redis_sadd --client-id --key --member --session-id "<session-id>" --output jsonAdds a member to a Redis setrobomotion redis redis_smembers --client-id --key --session-id "<session-id>" --output jsonGets all members of a Redis setrobomotion redis redis_srem --client-id --key --member --session-id "<session-id>" --output jsonRemoves a member from a Redis setrobomotion redis redis_sismember --client-id --key --member --session-id "<session-id>" --output jsonChecks if a value is a member of a Redis setrobomotion redis redis_keys --client-id --* --session-id "<session-id>" --output jsonGets all keys matching a patternrobomotion redis redis_exists --client-id --key --session-id "<session-id>" --output jsonChecks if a key exists in Redisrobomotion redis redis_expire --client-id --key --60 --session-id "<session-id>" --output jsonSets an expiration time on a keyrobomotion redis redis_ttl --client-id --key --session-id "<session-id>" --output jsonGets the remaining time to live of a key in secondsrobomotion redis redis_publish --client-id --channel --message --session-id "<session-id>" --output jsonPublishes a message to a Redis channel
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)