CLI Installation¶
Follow the steps enumerated below to install the Command Line Interface. Check the prerequisites before moving forward.
Requirements¶
- Get the following items from our Customer Success team:
- DataOS prime apikey
- Domain name of the DataOS context/instance
- Version of the CLI to be installed
-
Please ensure that the curl utility is installed on your system. To check, use this command:
If curl is not installed, follow the steps to download curl. -
Find out the operating system you are using, and the processor's architecture. The following is a list of supported Arch values:
Operating System Processor Arch MacOS
Intel darwin-amd64 (works for both intel & amd chips) AMD darwin-amd64 M1 & M2 darwin-arm64 Linux
Intel linux-386 AMD linux-amd64 M1 & M2 (64 bit) linux-arm64 Windows
32bit 386 64bit amd64 (works for both intel & amd chips)
Installation on MacOS¶
-
Export the environment variable PRIME_APIKEY to pass it to the subsequent commands(replace
prime_apikey
with the DataOS® API key to connect with the prime context). -
Determine processor architecture with the following command.
Sample output: You can use this output with the "darwin" prefix as ARCH value in your shell commands to specify the architecture. The available values aredarwin-amd64
,darwin-arm64
for different types of processors on macOS. -
Download the DataOS CLI binary using the below command (replace the
ARCH
value of the processor and theCLI_VERSION
to be installed):curl --silent --output dataos-ctl-{{ARCH}}.tar.gz --location --request GET "https://prime.tmdata.io/plutus/api/v1/files/download?name=dataos-ctl-{{ARCH}}.tar.gz&dir=cli-apps-{{CLI_VERSION}}&apikey=$PRIME_APIKEY"
Example:
A Mac user with intel-chip, installing the 2.8 version of the CLI would input the below command.
-
Optional step: Download the checksum file using the following command (replace the
ARCH
value of the processor and theCLI_VERSION
to be installed):curl --silent --output dataos-ctl-{{ARCH}}.tar.gz.sha256sum --location --request GET "https://prime.tmdata.io/plutus/api/v1/files/download?name=dataos-ctl-{{ARCH}}.tar.gz.sha256sum&dir=cli-apps-{{CLI_VERSION}}&apikey=$PRIME_APIKEY"
Example:
A Mac user with an intel-chip (identified as darwin-amd64 for the processor), installing the 2.8 version of the CLI would input the below command.
-
Optional step: Validate that the zip has not been tampered with.
Example:If the zip file has been downloaded as expected, you should get the following output:
-
Extract the dataos-ctl binary.
Example: Here is the expected output: -
Run the following command to place the extracted dataos-ctl in a directory that is in your PATH.
You will get the directory name from the output of the previous command. Example:In this case, it is
darwin-amd64/
.
🗣️ To access DataOS, you have to run this command every time you restart your computer’s terminal or open a new tab in the terminal. To avoid this, you should add the above path to your .zshrc file.
-
To add the path to your .zshrc file, you can follow the steps given in this toggle list. Click the toggle icon.
# make sure you are in your home directory "~/ (home/<user>)" # create a .zshrc file using the command below touch .zshrc # open the file using the command below ~/.zshrc # Copy & paste the path to your .zshrc file export PATH=$PATH:$HOME/.dataos/bin # close the .zshrc file window and load the file in the shell using source ~/.zshrc
-
You have successfully installed the CLI, now the next step is to initialize the DataOS context.
Typical Errors
1. Error after running the following command Error Message 2. Error after running the following command Error message These messages indicate that the correct executable file has not been downloaded by thecurl
command
Installation on Linux¶
-
Export the environment variable PRIME_APIKEY to pass it to the subsequent commands.
-
Determine processor architecture.
You will get the following output based on your processor.
if the output here appears as x86_64, it also means you have amd64 processor. The available ARCH values are linux-386, linux-amd64, linux-arm, linux-arm64.
-
Download the CLI binary file using the following command (replace the
ARCH
&CLI_version
before executing the command). -
Optional step: Update the
ARCH
value &CLI_version
in the following command to download the checksum file.Example:curl --silent --output dataos-ctl-linux-{{ARCH}}.tar.gz.sha256sum --location --request GET "https://prime.tmdata.io/plutus/api/v1/files/download?name=dataos-ctl-linux-{{ARCH}}.tar.gz.sha256sum&dir=cli-apps-{{CLI_VERSION}}&apikey=$PRIME_APIKEY"
For CLI version 2.5 getting installed, the command would be:
-
Optional step: Validate that the zip has not been tampered with. Update the
ARCH
value in the command.Expected output after running the above command:
-
Extract the dataos-ctl binary. Update the
ARCH
value in the commandExpected output:
-
Run the following command to place the extracted dataos-ctl in a directory that is in your PATH.
Example:
🗣️ To access DataOS, you have to run this command every time you restart your computer’s terminal or open a new tab in the terminal. To avoid this, you should add the above path to your .bashrc file.
-
To add the path to your .bashrc file, follow the below steps.
# make sure you are in your home directory "~/ (home/<user>)" # create a .bashrc file using the command below touch .bashrc # open the file using the command below xdg-open ~/.bashrc # copy & paste the path at the end of your .bashrc file export PATH=$PATH:$HOME/.dataos/bin # save and close the .bashrc file window and load the file in the shell using the command source ~/.bashrc
-
You have successfully installed the CLI, now the next step is to initialize the DataOS context.
Installation on Windows¶
-
Check whether your system has an Intel 64 bit chip or an AMD chip. To find out the architecture, use the following command.
Sample Output:- If the required value is 0 or x86, then it's a 32-bit architecture; in that case, use the
ARCH
value as 386. - If the required value is 6, 9, or x64, then it's a 64-bit architecture; in that case, use the
ARCH
value as amd64.
- If the required value is 0 or x86, then it's a 32-bit architecture; in that case, use the
-
Download the DataOS CLI .tar file using the following link in the browser (replace the
ARCH
,CLI_VERSION
, andPRIME_APIKEY
with respective values).https://prime.tmdata.io/plutus/api/v1/files/download?name=dataos-ctl-windows-{{ARCH}}.tar.gz&dir=cli-apps-{{CLI_VERSION}}&apikey={{PRIME_APIKEY}}
Example: To install CLI version 2.8 for a windows machine with amd64 processor and Prime Apikey as abcdefgh12345678987654321, run the following command.
-
Optional step: Download the checksum .shasum file using the following link in a browser (replace the
ARCH
,CLI_VERSION
, andPRIME_APIKEY
with respective values).Example:https://prime.tmdata.io/plutus/api/v1/files/download?name=dataos-ctl-windows-{{ARCH}}.tar.gz.sha256sum&dir=cli-apps-{{CLI_VERSION}}&apikey={{PRIME_APIKEY}}
To install CLI version 2.8 for a windows machine with amd64 processor and Prime Apikey as abcdefgh12345678987654321, run the following command.
-
Optional step: Validate that the .tar file has not been tampered with. Replace the
Example:tar-file-path
with the path of the downloaded tar file. Also, open the .shasum file in a text editor and copy the hash value and paste it inside quotes in place ofhash-value-from-shasum-file
.(Get-FileHash -Algorithm SHA256 -Path ./Downloads/dataos-ctl-windows-amd64.tar.gz).hash -eq '7d48cb3f60ab4821dd69dddd6291'
Sample output:
If the value is True, validation is successful.
-
The next step is to unzip the downloaded .tar file. To extract it, you will need an archiver utility like Winrar.
-
Open Winrar and highlight the zipped .tar file (it should appear with other downloaded files in the lower part of the page), and click the “Extract to” button on the top. Place it in your chosen directory.
You will always use this directory to run DataOS. To open the DataOS from anywhere in the system, place the extracted file in a directory that is in your PATH. To add the directory in PATH, refer to Setting the Path and Variables in Windows.
You have successfully installed the CLI, now the next step is to initialize the DataOS context.
Click here to proceed to CLI Initialization