CLI
Overview

CLI

The Kubling CLI (Command Line Interface) is a single, statically compiled, dependency-free executable, named kdv.

The main goal of the CLI is to facilitate common tasks required when configuring instances. It is designed to be easily embedded into pipelines, as well as into developers' environments.

A note on its size

Although Kubling is not a heavy application (its OCI Image is ~125MB), and its Community Edition (CE) version includes nearly all the features needed during development—making it a perfect fit for local development environments—certain tasks like testing can be challenging and time-consuming if every small change to a Script Module requires restarting a test container.

On the other hand, CLI tools and packages are typically small, often just a few KB in size, especially in the Linux ecosystem. However, the first thing you'll notice is that kdv is relatively large compared to other CLI tools.

This is because kdv contains roughly half of the packages and dependencies used by the server itself, including the Query Engine, Data Sources layer, including translators and adapters, and the JavaScript interpreter.

The reason for embedding all these packages into the CLI is that we have created a special test command, which helps you write and execute integration tests declaratively. This is part of our effort to integrate with popular IDEs like Visual Studio Code.

We are planning to release a smaller version without testing related commands. See our roadmap for more information.

Distribution

For local development environments we recommend using the binary file whose distribution channel is still under development.

In pipelines, workflows or in case you prefer using containers, you can find them here (opens in a new tab).

Commands

bundle

It aggregates various utilities for working with bundle files, like Modules.

Subcommands

genmod

Generates a JavaScript Module file.

Name
TypeDescriptionDefault Value
Directory PathParameter(0)Path to the root of the directory containing Module's code.
-o, --outputOptionFull file name of the generated bundle zip file.
-p, --parseOptionWhen enabled, all JavaScript files are parsed before bundle is generated.false

Sample usage:

kdv bundle genmod /dbvirt-samples/azure/modules/delegate -o /dbvirt-samples/azure/modules/azure-module-bundle.zip --parse

test

Utilities for performing tests.

Subcommands

integration

Runs an Integration test plan.

NameTypeDescriptionDefault Value
File PathParameter(0)Test plan manifest file path.

Sample usage:

kdv test integration /dbvirt-samples/appmodel/integration-test-plan.yaml

More about the test framework in the next section.

cert

Utilities for working with Kubling Server and Client certificates.

Subcommands

create

Creates a pair of certificate stores to use in Server and Client.

KetStore type used during generation is PKCS12, whereas for the digital signature, the SHA512withRSA encryption is used.

Name
TypeDescriptionDefault Value
-v, --validityOptionSERVER and CLIENT certificate store validity expressed in days.180
-s, --serverOptionFull file name of the generated SERVER certificate store../server.ks
-c, --clientOptionFull file name of the generated CLIENT certificate store../client.ks
-p, --clientPassOptionCLIENT certificate store password.(Random String)
-x, --serverPassOptionSERVER certificate store password.(Random String)
-o, --overwriteOptionOverwrite store files if they already exist.false

Sample usage:

kdv cert create -s /certs/server.ks -c /certs/client.ks -x myserverpass -p myclientpass -o

Using the containerized version

The general usage, assuming you use Docker, is as follows:

docker run --rm -v [/your/project/path]:[/path/in/container] kubling/dbvirt-cli:latest [command] [subcommand] [params] [options]
  • [/your/project/path]: Any system's directory that contains one or several Kubling project (like modules), needed by the command.
  • [path/in/container]: The mount point inside the container.
  • command: The kdv command to be executed, along with its subcommand, parameters and options.

Sample usage:

docker run --rm -v /root/dbvirt-samples/:/dbvirt-samples/ kubling/dbvirt-cli:latest bundle genmod /dbvirt-samples/azure/modules/delegate -o /dbvirt-samples/azure/modules/delegate/azure-module-bundle.zip