Valkey CLI
$ valkey-cli Official High Riskvalkey-cli is the official CLI for Valkey (the open-source Redis fork under the Linux Foundation). It supports direct --json and --csv command serialization, cursor-safe --scan key iteration instead of blocking KEYS *, and secure auth via VALKEYCLI_AUTH.
brew install valkey Prefer valkey-cli --json and --scan over Valkey/Redis MCP servers for direct sub-millisecond debugging and zero schema overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json, --csv, --raw, and --scan for single-shot non-interactive commands, though raw-text commands like INFO bypass --json and interactive mode opens if no command is supplied.
--jsonserializes RESP3 replies into JSON--scan --patternavoids blockingKEYS *
VALKEYCLI_AUTH keeps secrets out of process lists, but dangerous server commands (FLUSHALL, FLUSHDB, SHUTDOWN) have no confirmation prompt or client read-only flag.
VALKEYCLI_AUTHenv var avoids-aCLI leakage- Destructive commands (
FLUSHDB) execute immediately
Fast C binary distributed via Homebrew (brew install valkey) and Linux packages, plus Windows builds/WSL.
- Lightweight compiled binary with zero runtime dependencies
Covers key inspection, --stat, --bigkeys, --latency, and cluster/TLS flags (--tls) in one binary.
- Built-in diagnostics (
--bigkeys,--hotkeys,--stat)
Official Linux Foundation Valkey project (valkey-io/valkey) with broad industry backing and BSD-3-Clause licensing.
- Linux Foundation official Valkey distribution
Clear CLI guide on valkey.io and structured --help output.
- Official CLI reference at valkey.io/topics/cli
Security, Auth & Guardrails
Supports VALKEYCLI_AUTH (and REDISCLI_AUTH fallback) environment variables, or --user / --askpass.
BSD-3-Clause open-source Linux Foundation project; free.
# Valkey CLI Agent Rules - Always use `--scan --pattern` instead of `KEYS *` on production or large datasets. - Never run `FLUSHALL`, `FLUSHDB`, or `CONFIG SET` without explicit user confirmation. - Pass passwords via `VALKEYCLI_AUTH` env var instead of `-a <password>` on the command line.
Agent-Ready Command Recipes
Safe Read-Only Queries
valkey-cli -h 127.0.0.1 -p 6379 --scan --pattern "session:*" | head -n 50
Iterates keys incrementally using cursor-based SCAN instead of blocking the server with KEYS *.
valkey-cli -h 127.0.0.1 -p 6379 --json HGETALL user:1001
Serializes the RESP3 response of HGETALL into valid JSON.
Controlled Writes & Previews
valkey-cli -h 127.0.0.1 -p 6379 --json SET cache:probe "ok" EX 60
Writes a test key with a 60-second expiration (EX 60) and outputs JSON confirmation.
Strengths for Agents
- + Native
--jsonand--csvflags format structured RESP3 key/hash/list values cleanly. - +
--scan --patternprovides non-blocking key discovery. - +
VALKEYCLI_AUTHkeeps passwords out of shell history and process listings.
Caveats & Pitfalls
- ! Diagnostic commands like
INFOorCLIENT LISTstill emit raw text even with--json. - ! No client-side
--dry-runor confirmation gate on destructive commands likeFLUSHALLorDEL.