AWS CLI
The AWS CLI works with Hive Buckets. You need an access key.
Configure a profile
Section titled “Configure a profile”aws configure --profile dockhive# AWS Access Key ID: DH...# AWS Secret Access Key: <your secret># Default region name: auto# Default output format: json
aws configure set s3.addressing_style path --profile dockhivePoint every command at the endpoint with --endpoint-url, or save it in the profile (AWS CLI 2.13 and later) so you can leave it out:
[profile dockhive]region = autoendpoint_url = https://s3.dockhive.ios3 = addressing_style = path multipart_threshold = 64MB multipart_chunksize = 16MBThe examples below assume export AWS_PROFILE=dockhive and pass --endpoint-url for clarity.
Everyday commands
Section titled “Everyday commands”EP=https://s3.dockhive.io
# Upload a file and a folderaws s3 cp ./report.pdf s3://my-app-uploads/reports/report.pdf --endpoint-url $EPaws s3 cp ./images s3://my-app-uploads/images/ --recursive --endpoint-url $EP
# Listaws s3 ls --endpoint-url $EP # your bucketsaws s3 ls s3://my-app-uploads/reports/ --endpoint-url $EP
# Downloadaws s3 cp s3://my-app-uploads/reports/report.pdf . --endpoint-url $EP
# Mirror a folder (only changed files are sent; --delete removes files that are gone locally)aws s3 sync ./public s3://my-app-assets/ --delete --endpoint-url $EP
# Deleteaws s3 rm s3://my-app-uploads/reports/report.pdf --endpoint-url $EPaws s3 rm s3://my-app-uploads/tmp/ --recursive --endpoint-url $EP
# Share a file for one houraws s3 presign s3://my-app-uploads/reports/report.pdf --expires-in 3600 --endpoint-url $EPaws s3 cp and aws s3 sync switch to multipart uploads for large files automatically. Keep multipart_chunksize at 100 MB or less; the default of 8 MB is fine. See Limits.
Lower-level commands (s3api)
Section titled “Lower-level commands (s3api)”aws s3api exposes individual S3 operations:
# Object details and tagsaws s3api head-object --bucket my-app-uploads --key reports/report.pdf --endpoint-url $EPaws s3api put-object-tagging --bucket my-app-uploads --key reports/report.pdf \ --tagging 'TagSet=[{Key=team,Value=finance}]' --endpoint-url $EP
# Create a bucket (needs an Admin key for all buckets)aws s3api create-bucket --bucket my-new-bucket --endpoint-url $EP
# Turn on versioning (needs an Admin key)aws s3api put-bucket-versioning --bucket my-app-uploads \ --versioning-configuration Status=Enabled --endpoint-url $EPaws s3api list-object-versions --bucket my-app-uploads --prefix reports/ --endpoint-url $EPMore s3api examples are on the CORS, versioning, bucket policy and lifecycle pages.
Other S3 tools
Section titled “Other S3 tools”Tools such as rclone, s3cmd, Cyberduck and restic work too. Use the same settings everywhere: endpoint https://s3.dockhive.io, region auto, path-style addressing, and your DH... access key.