Command Line

The lev command line application that is used to submit API commands, retrieve the results, and check the status of running jobs.

Installation

Below are specific instructions for installing the application in Windows, MacOS, and Linux

Windows

  1. Download the Windows executable
  2. Move lev into %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
  3. Open PowerShell by opening the Windows menu and typing “PowerShell”
  4. Run lev help
  5. If the application is correctly installed you should see a usage message like this:

A windows terminal window showing the levitate help file

Mac OS

  1. Download the appropriate binary for your machine by running the following command in a terminal
    1. Intel Macs
       curl -LO https://storage.googleapis.com/levitate-engine/latest/external/darwin/amd64/lev
      
    2. Apple Silicon Macs (M1, M2, etc)
       curl -LO https://storage.googleapis.com/levitate-engine/latest/external/darwin/arm64/lev
      
  2. Copy the binary with the following command: sudo cp lev /usr/local/bin/lev
    1. If you do not have permission to write to /usr/local/bin you can copy the binary to any directory (e.g. $HOME/bin) and add that directory to your PATH variable by adding a line like this to your .bashrc or .zshrc file:
       export PATH=$HOME/bin:$PATH
      
  3. Make the file executable with chmod +x /usr/local/bin/lev (or the path you copied the file to in step 2.1 above)
  4. Run lev help
  5. If the application is installed correctly you should see a usage message describing the use of the application.

If you do not have permission to run sudo or write to /usr/local/bin/lev you can instead copy lev to your home directory

Linux

  1. Download the Linux binary by running the following command in a terminal:
    curl -LO https://storage.googleapis.com/levitate-engine/latest/external/linux/amd64/lev
    
  2. Copy the binary with the following command: sudo cp <binary-name> /usr/local/bin/lev
    1. If you do not have permission to write to /usr/local/bin you can copy the binary to any directory (e.g. $HOME/bin) and add that directory to your PATH variable by adding a line like this to your .bashrc or .zshrc file:
       export PATH=$HOME/bin:$PATH
      
  3. Make the file executable with chmod +x /usr/local/bin/lev (or the path you copied the file to in step 2.1 above)
  4. Run lev help
  5. If the application is installed correctly you should see a usage message describing the use of the application.

Upgrading

Once the command line application has been initially installed, it can be upgraded to the latest version by running the command lev upgrade. If an upgrade is available, you will be prompted to install it.

Initial Configuration

Before using the command line application for the first time, you need to initialize the configuration. To do this, run

lev init

You will be asked to enter your server address, which is the domain name you were given during onboarding (engine.<codename>.levitate.bio). Once that is entered a web browser window will be opened with a dialog box. Click ‘Confirm’, log in using your Levitate Bio username and password if prompted, and Engine should be ready to use.

If you are prompted for a client ID, secret, and port after running lev init your account is set up using the legacy auth system. You can get your client ID and secret from api-authorization.levitate.bio and for the port you should enter 443.

Submitting Jobs

A job can be submitted with a command like this:

lev engine submit <job type> <job options>

Where <job type> and <job options> vary depending on the job being submitted. See the specific documentation section for details.

The command will return a job ID and the username that the job was submitted under. The job ID is a unique ID which can be used to retrieve the results later.

the option --comment can be used to add a human readable comment to your job, this can be used to annotate jobs with information about the experiment being run, to make them easier to track.

Retrieving Results

To get the results of a completed job, run the following command:

lev engine get <job id> --output-dir <output directory>

Where <job id> is the ID of the job and <output directory> is the directory results should be output to. The output directory will be created if it does not already exist. If the job is still Running, you cannot get the results yet and the command will exit.

Listing running jobs

To list the currently running jobs, run the following command:

lev engine list

This will result in a table listing the Job ID, status, age of the job, comments, and the options the job was run with.

Deleting jobs

To delete completed jobs, run the following command:

lev engine delete <job id>

where <job id> is the ID of a submitted job.

Updated: