CLI only (for desktop clients)

CLI OVERVIEW

The odrive CLI provides users with an expressive, scriptable interface to the odrive Windows and MacOS Desktop Clients.

For information about the odrive Agent (supporting all platforms including Linux) and using the CLI with it, please see this section of our usage guide

odrive CLI (odrive.py/odrive.exe/odrive)

The CLI is used from the OS shell directly, or through shell scripts to control and enhance odrive Desktop Client and Agent behavior. The client is written in python (code available) and can be extended and customized to add additional functionality and automation.



INSTALL CLI ON WINDOWS

odrive.py is included with the odrive Desktop Client. You can find it in the following location: $HOME\.odrive\bin[version#]\cli\odrive.py

We also offer binary versions of the CLI client for download, for those that do not have/want to install python. You can find those here - Download CLI

The following is a convenient Powershell one-liner to download and install the python and binary versions of the CLI to '$HOME\.odrive-agent\bin'

$o="$HOME\.odrive-agent\bin";mkdir "$o" -FORCE;(New-Object System.Net.WebClient).DownloadFile("https://dl.odrive.com/odrive-py","$o\odrive.py");(New-Object System.Net.WebClient).DownloadFile("https://dl.odrive.com/odrivecli-win", "$o\oc.zip");$shl=new-object -com shell.application; $shl.namespace("$o").copyhere($shl.namespace("$o\oc.zip").items(),0x10);del "$o\oc.zip";


The following command will display the available client commands: 

odrive.exe -h
python odrive.py -h

As long as you have the odrive Desktop Client running, you can use the CLI to control its underlying Progressive Sync Engine. For example, the following command will show the current status of the odrive desktop client sync engine: 

odrive.exe status
python odrive.py status


INSTALL CLI ON MACOS

odrive.py is included with the odrive Desktop Client. You can find it in 

$HOME/.odrive/bin/[version#]/odrive.py

We also offer binary versions of the CLI client for download, for those that do not have/want to install python. You can find those here - Download CLI  

Running the following command inside a terminal session will install the python and binary versions of the CLI to $HOME/.odrive-agent/bin automatically:

od="$HOME/.odrive-agent/bin" && curl -L "https://dl.odrive.com/odrive-py" --create-dirs -o "$od/odrive.py" && curl -L "https://dl.odrive.com/odrivecli-osx" | tar -xvzf- -C "$od/"


The following command will display the available client commands: 

python odrive.py -h
odrive -h

As long as you have the odrive Desktop Client running, you can use the CLI to control its underlying Progressive Sync Engine. For example, the following command will show the current status of the odrive desktop client sync engine: 

python odrive.py status
odrive status


USING ODRIVE CLI

Since the odrive CLI client interfaces with the odrive Desktop Client, everything is already setup if you have the desktop client running and logged into odrive. Simply run the available CLI commands to perform your desired actions. 

For example:

Sync a folder

sync [local path to .cloudf placeholder file] 

python odrive.py" sync "$HOME/odrive/Dropbox.cloudf"
odrive sync "$HOME/odrive/Dropbox.cloudf"
odrive.exe sync "$HOME\odrive\Dropbox.cloudf"

Sync a file

sync [local path to .cloud placeholder file]

python odrive.py sync "$HOME/odrive/Dropbox/myfile.txt.cloud"
odrive.exe sync "$HOME\odrive\Dropbox\myfile.txt.cloud"
odrive sync "$HOME/odrive/Dropbox/myfile.txt.cloud"


DOWNLOAD CLI



ADDITIONAL RESOURCES AND INFORMATION

For a detailed walkthrough of the odrive CLI with detailed examples, check out this blog post!