How drunktrader/rediscli works
mazoni-redis CLI is a C++ Redis client whose main workflow accepts command-line arguments, connects to Redis, encodes and sends commands, then parses and displays RESP2 replies. With no command arguments it runs an interactive REPL; that mode also supports a separate Pub/Sub loop that polls terminal input and the Redis socket. The source excerpts show these runtime paths and the socket/protocol layers. README capabilities such as IPv4/IPv6, one-shot commands, and Redis command families are documented, but command families are forwarded rather than implemented as separate client subsystems.
Main entry points: CLI.cpp Interactive REPL · RedisClient.cpp TCP client · CommandHandler.cpp Argument and RESP encoder · ResponseParser.cpp RESP2 response parser
Components 10
CLI experience
- Argument entry
Client/main.cpp - CLI runtime
Client/src/CLI.cpp - Interactive REPL
Client/src/CLI.cpp - One-shot execution
Client/src/CLI.cpp - Pub/Sub loop
Client/src/CLI.cpp
Command protocol
- Argument and RESP encoder
Client/src/CommandHandler.cpp - RESP2 response parser
Client/src/ResponseParser.cpp
Redis connection
- TCP client
Client/src/RedisClient.cpp
Other components
- CLI user
- Redis server
Connections 17
- CLI user → Argument entry: invokes
README.md - Argument entry → CLI runtime: starts
Client/main.cpp - CLI runtime → TCP client: connects
Client/src/CLI.cpp - CLI runtime → One-shot execution: dispatches
Client/src/CLI.cpp - CLI runtime → Interactive REPL: enters
Client/src/CLI.cpp - Interactive REPL → Argument and RESP encoder: tokenizes and encodes
Client/src/CLI.cpp - One-shot execution → Argument and RESP encoder: encodes
Client/src/CLI.cpp - Interactive REPL → TCP client: sends command
Client/src/CLI.cpp - One-shot execution → TCP client: sends command
Client/src/CLI.cpp - TCP client → Redis server: sends over TCP
Client/src/RedisClient.cpp - Interactive REPL → RESP2 response parser: parses reply
Client/src/CLI.cpp - One-shot execution → RESP2 response parser: parses reply
Client/src/CLI.cpp - Interactive REPL → Pub/Sub loop: dispatches SUBSCRIBE
Client/src/CLI.cpp - Pub/Sub loop → Argument and RESP encoder: encodes subscription
Client/src/CLI.cpp - Pub/Sub loop → TCP client: sends subscription
Client/src/CLI.cpp - Pub/Sub loop → RESP2 response parser: parses messages
Client/src/CLI.cpp - Pub/Sub loop → Redis server: streams messages
README.md