AWS CLI
Use familiar AWS CLI syntax to read from XetHub repositories for easy workflow integration. Unlike AWS CLI, however, XetHub S3 commands add extra time travel capabilities to easily see what the state of the world was at any point in history.
All commands reference URIs in this format:
s3://user/repo/branch/path/to/file
Authenticate and configure
-
If you haven't already, install and authenticate with Git-Xet. If you've previously installed but never authenticated, generate a personal access token and run the displayed
git-xet login
command from your terminal to log in. -
Run
git xet s3config
to configure your XetHub S3 service profile. -
Following the printed instructions, source the
env
file to initialize your configuration.On Unix-like systems:
. $HOME/.xet/s3env
On Windows systems:
%HOMEDRIVE%%HOMEPATH%\.xet\s3env.bat
Basic commands
List repositories
aws s3 ls
List branches under a repository
aws s3 ls s3://user/repo
List files under a repository
aws s3 ls s3://user/repo/branch/path [--recursive]
Download files
aws s3 cp s3://user/repo/branch/path <local path> [--recursive]
Time travel commands
Like Xet CLI, XetHub's S3 endpoint also enables time travel on repositories using Git revision selection syntax. These commands apply to both repositories and files; simply add the path after the selection syntax to access specific files.
By commit
Show file information at a tag v0.1.0
or commit 261d82962a
(no branch needed):
aws s3 ls s3://user/repo/v0.1.0/path
aws s3 ls s3://user/repo/261d82962a/path
By relative commit
Show file information on main from two commits ago:
aws s3 ls s3://user/repo/main~2/path
By date
Show repository contents on main on any date:
aws s3 ls s3://user/repo/main@{2024-02-29 12:00}
By relative date
Show repository contents on main from 2 days ago:
aws s3 ls s3://user/repo/main@{2.days.ago}
By commit message
Show repository files at a commit on main with a certain commit message, e.g., “add 600 images”:
aws s3 ls s3://user/repo/main^{/"add 600 images"}/path