Installing the V2 Command-line interface¶
This article explains the procedure for installing and configuring the new researcher Command Line Interface (CLI).
Important
This document refers to the new CLI which only works with clusters of version 2.18 and up. The installation instructions for the older CLI are here.
Enabling the V2 CLI¶
Under General settings → Workloads, enable the flag Improved command line interface
Installing the CLI¶
- Click the Help (?) icon in the top right corner
- Select Researcher Command Line Interface
- Select the cluster you want the CLI to communicate with
- Select your computer’s operating system
- Copy the installer command and run it in the terminal or download the binary file for Windows OS
- Follow the installation process instructions
- Click
Enter
to use the default values (recommended)
Testing the installation¶
To verify the CLI client was installed properly
- Open the terminal
- Run the command
runai version
Configuring the CLI¶
Follow the steps below to configure the CLI.
Setting the Control plane URL¶
The following step is required for Windows users only. Linux and Mac clients are configured via the installation script automatically
Run the command runai config set --cp-url <CONTROL_PLANE_URL>
. This will also create the config.json
file in the default path.
Authenticating the CLI¶
After installation, sign in to the Run:ai platform to authenticate the CLI:
- Open the terminal on your local machine.
- Run
runai login
. - Enter your username and password on the Run:ai platform's sign-in page.
- Return to the terminal window to use the CLI.
Setting the default cluster¶
If only one cluster is connected to the account, it is set as the default cluster when you first sign in.
If there are multiple clusters, you must follow the steps below to set your preferred cluster for workload submission:
- Open the terminal on your local machine.
- Run
runai cluster
and select the desired cluster from the interactive menu.
Alternatively:
- Open the terminal on your local machine.
- Run
runai cluster list
to find the desired cluster name. - Run the following command
runai cluster set <CLUSTER_NAME>
.
Setting a default project¶
Set a default working project, to easily submit workloads without mentioning the project name in every command.
- Open the terminal on your local machine.
- Run
runai project
and select the desired cluster from the interactive menu.
alernativly
- Open the terminal on your local machine.
- Run
runai cluster list
to find the desired project name. - Run the following command
runai project set <PROJECT_NAME>
- If successful, the following message is returned
project <PROJECT_NAME> configured successfully
Validating the configuration¶
To view the current configuration run runai config generate --json
Installing command auto-completion¶
Auto-completion assists with completing the command syntax automatically for ease of use. Auto-completion is installed automatically.
The interfaces below require manual installation:
- Edit the file
~/.zshrc
- Add the following code:
- Install the bash-completion package
- Choose your operating system:
Mac:brew install bash-completion
Ubuntu/Debian:sudo apt-get install bash-completion
Fedora/Centos:sudo yum install bash-completion
- Edit the file
~/.bashrc
and add the following lines:
Add the following code in the powershell profile:
runai.exe completion powershell | Out-String | Invoke-Expression
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete