Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Redis CLI

$ redis-cli Official High Risk
Redis · Database & Data · RSALv2 / SSPLv1 (Redis 7.4+) / BSD-3-Clause (<=7.2) · macos / linux / windows

redis-cli connects to Redis and Redis-compatible servers (like Valkey) to execute commands, inspect server metrics (INFO), scan keys safely (--scan), and benchmark latency. Runs non-interactively whenever a command is passed as arguments, though it outputs raw RESP/text rather than JSON.

FCRS-1.0 Score
81 /100
Good
Medium Confidence
Zero-Friction Install
brew install redis
CLI vs MCP Decision CLI Preferred vs MCP

redis-cli --scan --pattern ... and redis-cli INFO give fast direct cache diagnostics without an MCP server.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

Non-interactive when command arguments are passed, supports --raw, --csv, --scan, and REDISCLI_AUTH, though lacks --json.

  • Supports REDISCLI_AUTH, --raw, --csv, and --scan; no --json
Trust & Safety 18 / 25

--scan avoids server stalls, but redis-cli has no client-side read-only flag and FLUSHALL/KEYS * are easy footguns.

  • No client-side --readonly guard; dangerous commands rely on server ACLs
Setup & Portability 13 / 15

Available via Homebrew and OS packages (redis-tools) across macOS, Linux, and Windows (WSL).

  • Fast C binary via brew install redis or redis-tools
Utility & Efficiency 14 / 15

Essential, ultra-fast diagnostic tool for Redis/Valkey key inspection, TTL checks, and latency monitoring.

  • Direct RESP client with --latency, --bigkeys, and --scan
Maintenance & Lineage 9 / 10

Official Redis client maintained in redis/redis (with BSD-licensed Valkey fork alternative).

  • Official redis/redis repository
Docs & Verifiability 8 / 10

Well-documented CLI guide at redis.io/docs/latest/develop/tools/cli/.

  • Official docs at redis.io

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key
Credential Storage

Password via REDISCLI_AUTH env var (recommended over -a argv flag) or URI in -u.

Side Effects
Read-Only Remote Write Destructive
Cost & Quotas

Free for local and self-hosted use; Redis 7.4+ moved to dual RSALv2/SSPLv1 (Valkey retains BSD-3-Clause).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# redis-cli Agent Rules
- Always pass the Redis command as CLI arguments (never launch interactive `redis-cli` prompt).
- Use `--scan --pattern ... | head` instead of `KEYS *`, and `REDISCLI_AUTH` instead of `-a`.
- NEVER run `FLUSHALL`, `FLUSHDB`, `CONFIG SET`, or `SHUTDOWN`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check Redis server memory and stats
redis-cli -u "$REDIS_URL" INFO memory

Reads memory utilization and eviction counters safely.

Scan keys without blocking the server
redis-cli -u "$REDIS_URL" --scan --pattern 'session:*' | head -n 50

Uses non-blocking SCAN cursor iteration instead of dangerous KEYS *.

Strengths for Agents

  • + --scan and --bigkeys provide production-safe diagnostics without blocking the Redis event loop.
  • + REDISCLI_AUTH avoids leaking passwords on the process command line.
  • + Zero runtime overhead and sub-millisecond execution.

Caveats & Pitfalls

  • ! No --json output mode (only raw/line/CSV).
  • ! Running KEYS * or FLUSHALL on production instances can cause severe outages.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI