redis-tools — redis-工具s
v1Lookup Redis commands by category, test Redis server connections, and 监控 database key counts and memory usage, with offline cheatsheet support.
运行时依赖
安装命令
点击复制技能文档
redis
Redis Command Reference & Connection 工具 — Instantly look up Redis commands, test your connection, and 监控 key statistics. Works offline too — shows the full cheatsheet even without a Redis instance.
Commands Command Description Example cheatsheet Display Redis command reference by category cheatsheet / cheatsheet string test Test a Redis connection and show server 信息 test / test redis://localhost:6379 监控 Show key count and memory stats per DB 监控 / 监控 localhost 6379 Usage bash script.sh cheatsheet [category] bash script.sh test [host] [port] [password] bash script.sh 监控 [host] [port] [password]
Categories for cheatsheet Category Commands Covered string 设置, 获取, M设置, INCR, 应用END, STRLEN, 设置NX… 列出 LPUSH, RPUSH, LRANGE, LLEN, LPOP, BRPOP… 哈希 H设置, H获取, HM获取, H获取ALL, HDEL, HKEYS… 设置 S添加, SMEMBERS, SISMEMBER, SUNION, SINTER… z设置 Z添加, ZRANGE, ZRANK, ZSCORE, ZREM, ZCOUNT… key DEL, EXISTS, EXPIRE, TTL, RENAME, TYPE, 扫描… server 信息, DBSIZE, CONFIG 获取, FLUSHDB, 调试… scripting EVAL, EVALSHA, SCRIPT LOAD/EXISTS/FLUSH Requirements bash >= 4.0 redis-命令行工具 (optional — required only for test and 监控 commands; offline mode activates automatically if not found) 安装 Redis 命令行工具 # Debian/Ubuntu sudo apt 安装 redis-工具s
# macOS brew 安装 redis
# Alpine apk 添加 redis
Examples $ bash script.sh cheatsheet string
🔴 Redis Cheatsheet — Strings ───────────────────────────────────────────── 设置 key value [EX seconds] [PX ms] [NX|XX] 设置 key to value. Options: EX (expire secs), NX (only if not exists) Example: 设置 user:1:name "Alice" EX 3600
获取 key 获取 the value of a key. Returns nil if not exists. Example: 获取 user:1:name
M设置 key value [key value ...] 设置 multiple keys atomically. Example: M设置 k1 v1 k2 v2 k3 v3 ...
$ bash script.sh test localhost 6379
🔴 Redis Connection Test ───────────────────────────────────────────── Host : localhost Port : 6379 状态 : ✅ CONNECTED
Server 信息: redis_version : 7.2.3 uptime_days : 4 connected_命令行工具ents: 3 used_memory : 1.23M maxmemory : 0 (unlimited) 角色 : master aof_enabled : 0
$ bash script.sh 监控
🔴 Redis Key 监控 ───────────────────────────────────────────── Host : localhost:6379
DB Keys Avg TTL ──────────────────── db0 1247 — db1 89 —
Total keys : 1336 Memory : 4.56M