Red is a lightweight command-line interface (CLI) tool built in modern C++ for interacting with the Violet database server. It supports both IPv4 and IPv6 and communicates over the RESP (REdis Serialization Protocol).
- Supports IPv4 and IPv6
- Fully RESP-compliant
- Interactive REPL and one-shot command modes
- Built-in command hints (optional)
All commands are case-insensitive.
STATUS– Returns connection statusECHO <msg>– Returns the same messageFLUSHALL– Clears all stored data
SET <key> <value>– Stores a string valueGET <key>– Retrieves the value for the given keyDEL <key>– Deletes the keyEXPIRE <key> <seconds>– Sets TTL on a keyKEYS– Lists all keysTYPE <key>– Returns type of the key (string, list, hash, none)RENAME <old> <new>– Renames a key
LGET <key>– Retrieves all list elementsLLEN <key>– Returns list lengthLPUSH <key> <v1> [v2 ...]– Push values to headRPUSH <key> <v1> [v2 ...]– Push values to tailLPOP <key>/RPOP <key>– Pop from head/tailLREM <key> <count> <value>– Remove occurrencesLINDEX <key> <index>– Get element at indexLSET <key> <index> <value>– Set element at index
HSET <key> <field> <value>– Set field in hashHGET <key> <field>– Get field from hashHEXISTS <key> <field>– Check if field existsHDEL <key> <field>– Delete field from hashHLEN <key>– Number of fields in hashHKEYS <key>– All field namesHVALS <key>– All valuesHGETALL <key>– All field/value pairsHMSET <key> <f1> <v1> [f2 v2 ...]– Set multiple fields
help– Displays helpquit– Exits CLI
- Clone the repository:
git clone https://github.com/Probatio-Diabolica/Red.git
cd Red- Build the project:
./build.sh- Run the CLI:
./red -h <host> -p <port>Omit flags to use defaults (127.0.0.1:6379).
- Unix/Linux or WSL environment
- CMake (>=3.10)
- C++17 compatible compiler (GCC or Clang)
Red is designed to work seamlessly with Violet, a custom Redis-like database server written in C++.