Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

CLI-TronaDB

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.


Features

  • 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.

Getting Started

Follow these instructions to build and run the CLI-TronaDB client.

Prerequisites

  • A C++17 compatible compiler (like g++)
  • CMake (version 3.10 or higher)
  • make

Build Instructions

  1. Clone the repository:

    git clone <your-repository-url>
    cd cli-tronadb
  2. Create a build directory:

    mkdir build && cd build
  3. Run CMake and Make:

    cmake ..
    make

    This will create the cli_tronadb executable in the build directory.

Usage Guide

Interactive (REPL) Mode

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.

One-Shot Command Mode

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"

About

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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages