Skip to content
Skillpedia
General coding48k · #3984

redis-cli

Lets your agent use the Redis command line. It's useful for querying, inspecting, or managing the Redis database directly from the command line.

What it does

redis-cli is a tool to talk to the Redis database directly from your computer. It allows you to view, change, or manage the data stored in Redis.

When to use it

  • ✓When you need to see what's stored in a specific Redis key.
  • ✓To add or modify a value for a Redis key.
  • ✓To check if Redis is working correctly.

Example of what to ask your AI

“How do I view the value of the key 'user:123' in Redis?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/redis-cli/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/redis-cli/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

You type commands in your terminal, as if you were talking to Redis. It can work in direct mode (one command and it exits) or interactive mode (you keep talking to it).

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill redis-cli

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/redis-cli/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

redis-cli — Redis Command Line Interface

When to Use

Use this skill when you need redis command-line interface (redis-cli) reference and usage guide. Use this skill whenever the user mentions redis-cli, Redis CLI, or any task involving querying, inspecting, debugging, or managing Redis from the command line. Triggers on key/value reads and writes, SCAN or keyspace...

redis-cli is the primary command-line tool for interacting with Redis. It supports two modes: command-line execution (run a command and exit) and interactive mode (a REPL with tab completion, history, and hints). It also provides special modes for monitoring, latency analysis, key space scanning, and data import/export.

Official resources: Redis CLI Docs | Commands | Download

Prerequisites

# Check if redis-cli is installed
redis-cli --version

# Install options:

# macOS (Homebrew)
brew install redis

# Ubuntu / Debian
sudo apt install redis-tools

# CentOS / RHEL
sudo yum install redis

# Alpine
apk add redis

# Build from source (binary only)
make redis-cli
# Binary at: src/redis-cli

# Docker (no installation needed)
docker run -it --rm redis redis-cli -h <host> -p <port> PING

Security Considerations

IMPORTANT: Redis provides powerful operations that can irreversibly modify or delete data. Pay close attention to the following safety guidelines:

  • Never pass passwords via -a in production — visible in shell history and process listings. Use REDISCLI_AUTH environment variable instead.
  • KEYS * blocks the server on large databases — always use SCAN in production code.
  • MONITOR logs all commands including sensitive data — use cautiously, and never for extended periods on production servers.
  • FLUSHALL / FLUSHDB are irreversible — verify target database with CLIENT LIST or INFO keyspace first.
  • --rdb transfer during write operations may produce inconsistent snapshots on busy servers.

Quick Reference

Connection

# Basic connection (default: 127.0.0.1:6379)
redis-cli
redis-cli -h redis15.localnet.org -p 6390 PING

# With password (prefer REDISCLI_AUTH env var for security)
redis-cli -a myUnguessablePazzzzzword123 PING

# URI connection
redis-cli -u redis://user:password@host:port/dbnum PING

# TLS
redis-cli --tls --cacert /path/to/ca.crt -h redis.example.com PING

# Specific database
redis-cli -n 2 DBSIZE

# IPv4/IPv6 preference
redis-cli -4 PING   # prefer IPv4
redis-cli -6 PING   # prefer IPv6

Command-Line vs Interactive Mode

# Command-line mode: execute one command and exit
redis-cli INCR mycounter
redis-cli GET mykey

# Interactive mode: type commands at the prompt
redis-cli
127.0.0.1:6379> PING
PONG
127.0.0.1:6379> SELECT 2
OK
127.0.0.1:6379[2]> DBSIZE
(integer) 1

The prompt shows host:port[db]. Use CONNECT <host> <port> to switch instances interactively.

Data Query Cheat Sheet

String operations (O(1)):

GET key                        # Get value
SET key value [NX|XX] [EX sec|PX ms|KEEPTTL]  # Set with conditions/TTL
SET key value GET              # Set new, return old value
GETSET key newvalue            # [Use SET key value GET instead]
MGET key1 key2 ...             # Get multiple values
INCR key                       # Increment integer (+1)
INCRBY key 10                  # Increment by amount
STRLEN key                     # String length
GETRANGE key 0 50              # Substring

Hash operations:

HGET key field                 # Get field value            O(1)
HMGET key f1 f2                # Get multiple fields        O(N)
HGETALL key                    # Get all fields/values      O(N)
HKEYS key                      # Get all field names        O(N)
HLEN key                       # Number of fields           O(1)
HEXISTS key field              # Check field exists         O(1)
HSCAN key 0 [MATCH pat]        # Iterate hash fields        O(1) per call

List operations:

LRANGE key 0 -1                # Get all elements           O(N)
LLEN key                       # List length                O(1)
LINDEX key 0                   # Get by index               O(N)
LPOS key value                 # Find element position      O(N)

Set operations:

SMEMBERS key                   # Get all members            O(N)

…
FAQ

How do I install redis-cli?

You can install it using package managers like Homebrew (macOS), apt (Ubuntu/Debian), or yum (CentOS/RHEL). You can also use it via Docker.

Is it safe to use passwords directly in the command?

It is not recommended. For production, use the REDISCLI_AUTH environment variable instead of typing the password directly in the command, as it can be saved in your history.

Which command should I use to see all keys?

The `KEYS *` command can lock up the server on large databases. In production, it's better to use the `SCAN` command to list keys safely.

Details

Original description by the author

Redis command-line interface (redis-cli) reference and usage guide. Use this skill whenever the user mentions redis-cli, Redis CLI, or any task involving querying, inspecting, debugging, or managing Redis from the command line.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3984
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills