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.

Installation

To use TensorBay CLI, please install TensorBay SDK first.

$ pip3 install tensorbay

Configuration

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

Set the accessKey into configuration:

$ gas auth [ACCESSKEY]

To show authentication information:

$ gas auth --get

TBRN

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:

tb:<dataset_name>[:<segment_name>][://<remote_path>]

Usage

CLI: Create a Dataset

$ gas dataset tb:<dataset_name>

CLI: List Dataset Names

$ gas dataset

CLI: Create a Draft

$ gas draft tb:<dataset_name> [-m <message>]

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>]