मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग48k · #5598

redis-cli

यह क्या करती है

redis-cli एक ऐसा टूल है जिससे आप अपने कंप्यूटर से सीधे Redis database से बात कर सकते हैं। इससे Redis में स्टोर डेटा देखा, बदला या मैनेज किया जा सकता है।

कब इस्तेमाल करें

  • ✓जब आपको देखना हो कि किसी खास Redis key में क्या स्टोर है।
  • ✓Redis key के लिए कोई value जोड़ने या बदलने के लिए।
  • ✓यह जांचने के लिए कि Redis सही तरीके से काम कर रहा है या नहीं।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/redis-cli/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“Redis में 'user:123' key की value कैसे देखूँ?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

आप अपने terminal में कमांड टाइप करते हैं, जैसे आप Redis से सीधे बात कर रहे हों। यह दो मोड में काम कर सकता है: direct mode (एक कमांड चलती है और टूल बंद हो जाता है) या interactive mode (जिसमें आप लगातार कमांड देते रहते हैं)।

तकनीकी सामग्री (मूल 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 -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)

…
अक्सर पूछे जाने वाले सवाल

redis-cli कैसे इंस्टॉल करूँ?

आप इसे Homebrew (macOS), apt (Ubuntu/Debian) या yum (CentOS/RHEL) जैसे package managers से इंस्टॉल कर सकते हैं। Docker के ज़रिए भी इसे इस्तेमाल किया जा सकता है।

क्या कमांड में सीधे password लिखना सुरक्षित है?

यह सुझाया नहीं जाता। production में REDISCLI_AUTH environment variable इस्तेमाल करें, password सीधे कमांड में न लिखें, क्योंकि वह आपकी history में सेव हो सकता है।

सारी keys देखने के लिए कौन सी कमांड इस्तेमाल करूँ?

बड़े database पर `KEYS *` कमांड server को रोक सकती है। production में 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.

repo: sickn33/agentic-awesome-skills

लोकप्रियता

GitHub स्टार
48k
रैंकिंग में स्थान
#5598
लाइसेंस
MIT
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

00-andruia-consultant

48k

आपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।

AI और एजेंटएजेंट

007

48k

आपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।

कोडिंगसिक्योरिटी

10-andruia-skill-smith

48k

आपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।

AI और एजेंटएजेंट

20-andruia-niche-intelligence

48k

आपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।

लेखन और डॉक्यूमेंटरिसर्च

मिलती-जुलती skills