CLI Commands#

The following table lists the currently supported CLI commands.(Table. 4).

Table 4 CLI Commands#

Commands

Description

gas auth

authentication operations.

gas config

config operations

gas dataset

dataset operations.

gas ls

list operations.

gas cp

copy operations.

gas rm

remove operations.

gas draft

draft operations.

gas commit

commit operations.

gas tag

tag operations.

gas log

log operations.

gas branch

branch operations

gas auth#

Work with authentication operations.

Authenticate the accesskey of the TensorBay account. If the accesskey is not provided, interactive authentication will be launched.

$ gas auth [ACCESSKEY]

Get the authentication information.

$ gas auth --get [--all]

Unset the authentication information.

$ gas auth --unset [--all]

gas config#

Work with configuration operations.

gas config supports modifying the configurations about network request and editor.

Add a single configuration, see the available keys and corresponding values about network request at request_configuration.

$ gas config [key] [value]

For example:

$ gas config editor vim
$ gas config max_retries 5

Show all the configurations.

$ gas config

Show a single configuration.

$ gas config [key]

For example:

$ gas config editor

Unset a single configuration.

$ gas config --unset <key>

For example:

$ gas config --unset editor

gas dataset#

Work with dataset operations.

Create a dataset.

$ gas dataset tb:<dataset_name>

List all datasets.

$ gas dataset

Delete a dataset.

$ gas dataset -d tb:<dataset_name>

gas ls#

Work with list operations.

List the segments of a dataset.(default branch)

$ gas ls tb:<dataset_name>

List the segments of a specific dataset revision.

$ gas ls tb:<dataset_name>@<revision>

List the segments of a specific dataset draft.

See gas draft for more information.

$ gas ls tb:<dataset_name>#<draft_number>

List all files of a segment.

$ gas ls tb:<dataset_name>:<segment_name>
$ gas ls tb:<dataset_name>@<revision>:<segment_name>
$ gas ls tb:<dataset_name>#<draft_number>:<segment_name>

Get a certain file.

$ gas ls tb:<dataset_name>:<segment_name>://<remote_path>
$ gas ls tb:<dataset_name>@<revision>:<segment_name>://<remote_path>
$ gas ls tb:<dataset_name>#<draft_number>:<segment_name>://<remote_path>

gas cp#

Work with copy operations.

Upload a file to a segment. The local_path refers to a file.

The target dataset must be in draft status, see gas draft for more information.

$ gas cp <local_path> tb:<dataset_name>#<draft_number>:<segment_name>

Upload files to a segment. The local_path refers to a directory.

$ gas cp -r <local_path> tb:<dataset_name>#<draft_number>:<segment_name>

Upload a file to a segment with a given remote_path, which is the target path on TensorBay. The local_path can refer to only one file.

$ gas cp <local_path> tb:<dataset_name>#<draft_number>:<segment_name>://<remote_path>

gas rm#

Work with remove operations.

Remove a segment.

The target dataset must be in draft status, see gas draft for more information.

$ gas rm -r tb:<dataset_name>#<draft_number>:<segment_name>

Remove a file.

$ gas rm tb:<dataset_name>#<draft_number>:<segment_name>://<remote_path>

gas draft#

Work with draft operations.

Create a draft with a title.

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

List the drafts of a dataset.

$ gas draft -l tb:<dataset_name>

Edit the draft of a dataset.

$ gas draft -e tb:<dataset_name>#<draft_number> [-m <title>]

Close the draft of a dataset.

$ gas draft -c tb:<dataset_name>#<draft_number>

gas commit#

Work with commit operations.

Commit a draft with a title.

$ gas commit tb:<dataset_name>#<draft_number> [-m <title>]

gas tag#

Work with tag operations.

Create a tag on the current commit or a specific revision.

$ gas tag tb:<dataset_name> <tag_name>
$ gas tag tb:<dataset_name>@<revision> <tag_name>

List all tags.

$ gas tag tb:<dataset_name>

Delete a tag.

$ gas tag -d tb:<dataset_name>@<tag_name>

gas log#

Work with log operations.

Show the commit logs.

$ gas log tb:<dataset_name>

Show commit logs from a certain revision.

$ gas log tb:<dataset_name>@<revision>

Limit the number of commit logs to show.

$ gas log -n <number> tb:<dataset_name>
$ gas log --max-count <number> tb:<dataset_name>

Show commit logs in oneline format.

$ gas log --oneline tb:<dataset_name>

Show commit logs of all revisions.

$ gas log --all tb:<dataset_name>

Show graphical commit logs.

$ gas log --graph tb:<dataset_name>

Show commit and open draft logs.

$ gas log --show-drafts tb:<dataset_name>

gas branch#

Work with branch operations.

Create a new branch from the default branch.

$ gas branch tb:<dataset_name> <branch_name>

Create a new branch from a certain revision.

$ gas branch tb:<dataset_name>@<revision> <branch_name>

Show all branches.

$ gas branch tb:<dataset_name>

Delete a branch.

$ gas branch --delete tb:<dataset_name>@<branch_name>