Downloading via CLI

For more advanced users, quick way to upload files to Latch is through the command line. To do this:

  1. Install the Latch CLI:
python3 -m pip install latch

The Latch CLI requires Python >=3.8 and < 3.11

  1. Next, authenticate your account. This can be done one of two ways:
  • On a machine with a browser

  • On a machine without a browser

If you’re on a computer where you’re logged into console.latch.bio, simply enter latch login which will authenticate you through the browser that you’re logged into.

  1. Now you are ready to copy data.

  2. The command to copy data is:

    latch cp <source> <destination>
    

    The path prefix to reference data within Latch is latch:///, so to reference the pipeline_outputs in my Latch Data root directory the path would be latch:///pipeline_outputs.

  3. An example command to download data would be,

    latch cp latch:///stuff/ local_folder
    

    which would downloads the contents of /stuff on Latch and puts them into local_folder on your local computer.

Copying data between different workspaces

By default LatchCLI references your personal workspace. To switch workspaces use the command:

latch workspace

which will allow you to select the workspace you want to use.

Alternatively you can reference different workspaces by workspace id in the path using the path prefix latch://{wsId}.account/.

To find your workspace ID go to (Account Settings > General).