Command Line Interface
Downloading via CLI
For more advanced users, quick way to upload files to Latch is through the command line. To do this:
- Install the Latch CLI:
python3 -m pip install latch
The Latch CLI requires Python >=3.8 and < 3.11
- 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.
-
Now you are ready to copy data.
-
The command to copy data is:
latch cp <source> <destination>
The path prefix to reference data within Latch is
latch:///
, so to reference thepipeline_outputs
in my Latch Data root directory the path would belatch:///pipeline_outputs
. -
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 intolocal_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.
latch://{wsId}.account/
.To find your workspace ID go to (Account Settings > General).