Getting Started with CLI

The TensorBay Command Line Interface is a tool to operate on datasets. It supports Windows, Linux, and Mac platforms.

TensorBay CLI can:

  • Create and delete dataset.

  • List data, segments and datasets on TensorBay.

  • Upload data to TensorBay.


To use TensorBay CLI, please install TensorBay SDK first.

$ pip3 install tensorbay


An accessKey is used for identification when using TensorBay to operate datasets.

Set the accessKey into configuration:

$ gas config <YOUR_ACCESSKEY>

To show configuration information:

$ gas config


TensorBay Resource Name(TBRN) uniquely defines the resource stored in TensorBay. TBRN begins with tb:. Default segment can be defined as "" (empty string). See more details in TBRN. The following is the general format for TBRN:



CLI: Create a Dataset

gas dataset tb:[dataset_name]

CLI: List Dataset Names

gas dataset

CLI: Create a Draft

gas draft tb:[dataset_name] -t [title]

CLI: List Drafts

gas draft -l tb:[dataset_name]

CLI: Upload a File To the Dataset

gas cp [local_path] tb:[dataset_name]#[draft_number]:[segment_name]

CLI: Commit the Draft

gas commit tb:[dataset_name]#[draft_number] -m [message]