Optable CLI
Using the Optable DCN command line tools

What is Optable CLI?

The Optable CLI (Command Line Interface) is a utility designed to enable an Optable data collaboration node (DCN) administrator to interact with the DCN and perform management tasks which would otherwise be done using the web-based DCN UI.

Who Should Use Optable CLI?

Using the Optable CLI requires authenticating to an Optable data collaboration node (DCN). The CLI is therefore designed to be used by DCN customers.

Downloading Optable CLI

The latest version of the Optable CLI can be downloaded from Optable's CDN:
Platform
Download Link
OS X (64-bit)
Latest build for Darwin 64-bit
Windows (64-bit)
Latest build for Windows 64-bit
Linux (64-bit)
Latest build for Linux 64-bit
Note that on OS X you may need to download the executable with curl instead of your browser in order to be able to execute it.
Note that on OS X or Linux you may need to chmod +x ./optable-cli before you can run the executable with ./optable-cli
Warning: v5 of the Optable CLI introduces some breaking changes in the login command.

Using Optable CLI

Optable CLI commands require authentication with a DCN user or service account. You can create and manage accounts from the Admin > Accounts section in your DCN UI.

Logging In With a User Account

You can login with your personal DCN user account by running optable-cli login <dcn-hostname>
The specified dcn-hostname should just be the hostname of your data collaboration node, without any protocol prefix. For example, if you login to your DCN UI by browsing to https://my-dcn.cloud.optable.co/admin, then your DCN hostname is just my-dcn.cloud.optable.co
A browser window will open automatically in which you will be able to authenticate using one of the methods described in Authentication.
Note that the CLI will automatically refresh your session but will require to manually relogin after 30 days of inactivity.

Logging In With a Service Account

If you want to script using the CLI, it's recommended to authenticate using a service account instead of your personal user account. Logging into a service account has the advantage of not expiring and not requiring re-authentication.
You can create a service account from the Admin > Accounts section in your DCN UI. Once created, you will be able to create a service key and download a JSON file embedding a private key.
Be sure to keep service account private key files protected as they contain authentication secrets!
You can run the optable-cli activate-service-account <path-to-key-file> command to add the service account private key file to the CLI configuration. You can then run CLI commands as the service account.
Note that the DCN only stores the public key corresponding to the service key which you have created. The private key is stored on the client side in the CLI configuration ($HOME/.config/optable by default). The private key is used to sign each request sent to the DCN.
If you suspect that your private key has been compromised, you can revoke a service key from the DCN UI by navigating to the service account in Admin > Accounts.

Help on Commands

You can get a list of all supported commands by running optable-cli --help
To get help on a specific command, run optable-cli <command> --help

DCN Contexts

You can connect to multiple DCNs using the CLI. When you login with the CLI as explained further above, the default context is used. If you would like to login to another DCN you can pass the -c <context-name> option to optable-cli when logging in.