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 auth [ACCESSKEY]
To show authentication information:
$ gas auth --get
TensorBay Resource Name(TBRN) uniquely defines the resource stored in TensorBay. TBRN begins with tb:
. See more details in TBRN <tensorbay_cli/tbrn:TensorBay Resource Name>
. The following is the general format for TBRN:
tb:<dataset_name>[:<segment_name>][://<remote_path>]
$ gas dataset tb:<dataset_name>
$ gas dataset
$ gas draft tb:<dataset_name> [-m <title>]
$ gas draft -l tb:<dataset_name>
$ gas cp <local_path> tb:<dataset_name>#<draft_number>:<segment_name>
$ gas commit tb:<dataset_name>#<draft_number> [-m <title>]
For users with multiple TensorBay accounts or different workspaces, CLI provides profiles to easily authenticate and use different accessKeys.
Set the accessKey into the specific profile, and show the specific profile's authentication information:
$ gas -p <profile_name> auth [ACCESSKEY]
$ gas -p <profile_name> auth -g
After authentication, the profiles can be used to execute other commands:
$ gas -p <profile_name> <command>
For example, list all the datasets with the given profile's accessKey:
$ gas -p <profile_name> ls
For users who want to use a temporary accessKey, CLI provides -k
option to override the authentication:
$ gas -k <Accesskey> <command>
For example, list all the datasets with the given accessKey:
$ gas -k <AccessKey> ls