CLI

These instructions explain how to register and authenticate using the MakeInfinite command line interface (CLI) for the Space and Time Managed DB. It uses Java to allow cross-platform support, running on Windows, MacOS, or Linux.

📘

Many examples in the docs will use the CLI and terminal as the primary tool. The CLI is a universal / OS & programming language agnostic way for developers to connect to the Space and Time Managed DB - but it's not the only way. Check out the pages on Solidity, REST API, SDKs, and more!


How to Connect to Space and Time Managed DB via CLI

Step 1: Download and Install the JavaJDK

Java is fairly standard install on most development machines. To test if you have Java installed, open a terminal / CMD and enter java --version which should return something like:

└─\[$] java --version

java 20.0.1 2023-04-18\
Java(TM) SE Runtime Environment (build 20.0.1+9-29)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)

If the Java version is lower than 20.0.1 or is not installed (returns an error):

  • Navigate to the JavaJDK page
  • Select your OS / Chip Architecture
  • Download the file named: jdk-<latest_version>_*
  • Follow install instructions per the installer for your operating system
  • Once complete, confirm Java is installed by running java --version as per above

Step 2: Install the SXTCLI Jar

To install the SXTCLI, there are two steps: download the .jar file, and create a short-cut to the .jar file.

Download the .JAR File

This link to the SxTCLI will take you to a top-level directory with all CLI versions. We highly recommended that you always install the latest version.

Inside the version folder, you'll see two files: .jar and .pom. For most uses, you only need the .jar file, and can ignore the .pom file. Save the downloaded .jar file to the location where you want the application to run.
(e.g., /applications/SXTCLI/ or /program files/SXTCLI/, etc).

Once downloaded, you can test the SXTCLI by opening a terminal or command window, navigate to the folder where you saved the .jar, and enter:
java -jar sxtcli-<version>.jar version

You should see a menu returned, something like: Version: 0.0.9

Add CLI to your Environment Path (optional)

While this step is technically optional, SXTCLI is significantly easier to use if you create an alias or shortcut to the .jar file, rather than always having to call java with a specific location.

Using your editor of choice, edit your shell profile:

Mac OSLinuxMicrosoft Windows WSL
~/.zshrc~/.bash_profile~/.bashrc

Add this line to the bottom, replacing <PathToJar> with the fully qualified path where you saved the downloaded jar file:

alias sxtcli='java -jar <PathToJar>/sxtcli-<LATEST_VERSION>.jar'

📘

While you're editing your shell profile, consider the best practice of setting up a dotenv (.env) file at the same time!

To test your alias, open a new terminal and type: sxtcli version
If the alias is working correctly, you'll see the same answer as the above step: Version: 0.0.6

👍

Congrats! You're ready to begin working with the SXTCLI!


Step 3: Set up a dotenv file (optional)

While also technically optional, we recommend that you set up an Environment Variable file, sometimes called a dotenv or ".env" file, to hold local secrets like your UserID and KeyPair. This is a general development best practice, not specific to MakeInfinite, however, you will see dotenv files used frequently in MakeInfinite docs, SDKs, etc.

See the best practices guide on using a Dotenv File for Secrets.

For the examples below (and almost all others in this documentation), we're assuming environment variables that match those seen here.