redis-cli
できること
redis-cliは、お使いのコンピューターから直接Redisデータベースとやり取りするためのツールです。Redisに保存されているデータを確認したり、変更したり、管理したりできます。
使う場面
- ✓特定のRedisキーに何が保存されているかを確認したいとき。
- ✓Redisのキーの値を追加または変更したいとき。
- ✓Redisが正しく動作しているかを確認したいとき。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/redis-cli/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Redisのキー「user:123」の値を確認するにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
Redisに話しかけるようにして、ターミナルにコマンドを入力します。直接モード(コマンドを1つ実行すると終了)または対話モード(接続したままコマンドを続けて入力)のどちらでも動作します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
-ain production — visible in shell history and process listings. UseREDISCLI_AUTHenvironment variable instead. KEYS *blocks the server on large databases — always useSCANin production code.MONITORlogs all commands including sensitive data — use cautiously, and never for extended periods on production servers.FLUSHALL/FLUSHDBare irreversible — verify target database withCLIENT LISTorINFO keyspacefirst.--rdbtransfer 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)
…
よくある質問
redis-cliはどのようにインストールしますか?
Homebrew(macOS)、apt(Ubuntu/Debian)、yum(CentOS/RHEL)などのパッケージマネージャーでインストールできます。Dockerを使うこともできます。
コマンドにパスワードを直接書いても安全ですか?
推奨されません。本番環境では、パスワードを直接コマンドに入力するのではなく、REDISCLI_AUTH環境変数を使ってください。直接入力すると、履歴に残ってしまう可能性があります。
すべてのキーを確認するにはどのコマンドを使えばよいですか?
`KEYS *`コマンドは、大規模なデータベースではサーバーを停止させる可能性があります。本番環境では、`SCAN`コマンドを使うと安全にキーを一覧表示できます。
詳細
作者による元の説明
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.
人気
- GitHubのスター
- 48k
- ランキング
- #5598
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。