CLI-TronaDB is the official command-line interface for the TronaDB server. It's a lightweight and powerful C++ tool that allows you to interact with your database in two modes: an interactive REPL or a one-shot command execution for scripting.
- Interactive Mode: Provides a REPL (Read-Eval-Print Loop) for an easy, conversational database session.
- One-Shot Commands: Execute commands directly from your shell, making it perfect for scripting and automation.
- User-Friendly Output: Intelligently parses RESP responses from the server into a human-readable format.
- Simple Connection Management: Easily specify the host and port of the TronaDB server you wish to connect to.
Follow these instructions to build and run the CLI-TronaDB client.
- A C++17 compatible compiler (like
g++) CMake(version 3.10 or higher)make
-
Clone the repository:
git clone <your-repository-url> cd cli-tronadb
-
Create a build directory:
mkdir build && cd build
-
Run CMake and Make:
cmake .. make
This will create the
cli_tronadbexecutable in thebuilddirectory.
Connect to a server and start an interactive session.
-
Connect to a local server on the default port (6379):
./cli_tronadb
You will be greeted with a prompt:
127.0.0.1:6379> -
Connect to a specific host and port:
./cli_tronadb -h my.server.com -p 8000
Inside the REPL, type help for more information or quit to exit.
Execute a single command and print the result directly to your terminal.
# Set a key
./cli_tronadb SET user:1 "Alice"
# Get the key
./cli_tronadb GET user:1
# Push items to a list
./cli_tronadb LPUSH mylist "item1" "item2"