Hangar CLI Documentation

The CLI described below is automatically available after the Hangar python package has been installed (either through a package manager or via source builds). In general, the commands require the terminals cwd to be at the same level the repository was initially created in.

Simply start by typing $ hangar --help in your terminal to get started!

hangar

hangar [OPTIONS] COMMAND [ARGS]...

Options

-v, --version

display the Hangar version currently installed

branch

operate on and list branch pointers.

hangar branch [OPTIONS] COMMAND [ARGS]...

create

Create a branch with NAME at STARTPOINT (short-digest or branch)

If no STARTPOINT is provided, the new branch is positioned at the HEAD of the staging area branch, automatically.

hangar branch create [OPTIONS] NAME [STARTPOINT]

Arguments

NAME

Required argument

STARTPOINT

Optional argument

list

list all branch names

Includes both remote branches as well as local branches.

hangar branch list [OPTIONS]

clone

Initialize a repository at the current path and fetch updated records from REMOTE.

Note: This method does not actually download the data to disk. Please look into the fetch-data command.

hangar clone [OPTIONS] REMOTE

Options

--name <name>

first and last name of user

--email <email>

email address of the user

--overwrite

overwrite a repository if it exists at the current path

Arguments

REMOTE

Required argument

fetch

Retrieve the commit history from REMOTE for BRANCH.

This method does not fetch the data associated with the commits. See fetch-data to download the tensor data corresponding to a commit.

hangar fetch [OPTIONS] REMOTE BRANCH

Arguments

REMOTE

Required argument

BRANCH

Required argument

fetch-data

Get data from REMOTE referenced by STARTPOINT (short-commit or branch).

The default behavior is to only download a single commit’s data or the HEAD commit of a branch. Please review optional arguments for other behaviors

hangar fetch-data [OPTIONS] REMOTE STARTPOINT

Options

-d, --aset <aset>

specify any number of aset keys to fetch data for.

-n, --nbytes <nbytes>

total amount of data to retrieve in MB/GB.

-a, --all-history

Retrieve data referenced in every parent commit accessible to the STARTPOINT

Arguments

REMOTE

Required argument

STARTPOINT

Required argument

init

Initialize an empty repository at the current path

hangar init [OPTIONS]

Options

--name <name>

first and last name of user

--email <email>

email address of the user

--overwrite

overwrite a repository if it exists at the current path

log

Display commit graph starting at STARTPOINT (short-digest or name)

If no argument is passed in, the staging area branch HEAD will be used as the starting point.

hangar log [OPTIONS] [STARTPOINT]

Arguments

STARTPOINT

Optional argument

push

Upload local BRANCH commit history / data to REMOTE server.

hangar push [OPTIONS] REMOTE BRANCH

Arguments

REMOTE

Required argument

BRANCH

Required argument

remote

Operations for working with remote server references

hangar remote [OPTIONS] COMMAND [ARGS]...

add

Add a new remote server NAME with url ADDRESS to the local client.

This name must be unique. In order to update an old remote, please remove it and re-add the remote NAME / ADDRESS combination

hangar remote add [OPTIONS] NAME ADDRESS

Arguments

NAME

Required argument

ADDRESS

Required argument

list

List all remote repository records.

hangar remote list [OPTIONS]

remove

Remove the remote server NAME from the local client.

This will not remove any tracked remote reference branches.

hangar remote remove [OPTIONS] NAME

Arguments

NAME

Required argument

server

Start a hangar server, initializing one if does not exist.

The server is configured to top working in 24 Hours from the time it was initially started. To modify this value, please see the --timeout parameter.

The hangar server directory layout, contents, and access conventions are similar, though significantly different enough to the regular user “client” implementation that it is not possible to fully access all information via regular API methods. These changes occur as a result of the uniformity of operations promised by both the RPC structure and negotiations between the client/server upon connection.

More simply put, we know more, so we can optimize access more; similar, but not identical.

hangar server [OPTIONS]

Options

--overwrite

overwrite the hangar server instance if it exists at the current path.

--ip <ip>

the ip to start the server on. default is localhost [default: localhost]

--port <port>

port to start the server on. default in 50051 [default: 50051]

--timeout <timeout>

time (in seconds) before server is stopped automatically [default: 86400]

summary

Display content summary at STARTPOINT (short-digest or branch).

If no argument is passed in, the staging area branch HEAD wil be used as the starting point. In order to recieve a machine readable, and more complete version of this information, please see the Repository.summary() method of the API.

hangar summary [OPTIONS] [STARTPOINT]

Arguments

STARTPOINT

Optional argument