Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 1.8 KB

README.md

File metadata and controls

78 lines (59 loc) · 1.8 KB

s3hub - user-friendly S3 management tool

The s3hub command provides following features:

  • Create a S3 bucket
  • List S3 buckets
  • List S3 objects in the S3 bucket
  • Copy files to S3 bucket
  • Delete contents from the S3 bucket
  • Delete the S3 bucket
  • Interactive mode

How to install

go install github.com/nao1215/rainbow/cmd/s3hub@latest

How to use

The s3hub command allows you to specify a profile as an option, but it is more user-friendly to use the AWS_PROFILE environment variable. S3hub operates without requiring the 's3://' protocol to be added to the bucket name.

Interactive mode

Interactive mode provides a user-friendly interface for managing S3 resources without the need for command-line arguments. You can use the interactive mode by omitting the arguments.

s3hub


### Create a bucket(s)

```shell
s3hub mb ${YOUR_BUCKET_NAME}

create_bucket

List buckets

s3hub ls

ls_bucket

List contents of a bucket

s3hub ls ${YOUR_BUCKET_NAME}

ls_bucket_objects

Copy files to a bucket

From local to S3:

s3hub cp ${YOUR_FILE_PATH} ${YOUR_BUCKET_NAME}

From S3 to local:

s3hub cp ${YOUR_BUCKET_NAME} ${YOUR_FILE_PATH}

Delete a object from a bucket

If you want to delete a specific object, use the following command:

s3hub rm ${CONTENT_PATH_IN_BUCKET}/${S3_KEY}

If you want to delete all contents in a bucket, use the wildcard:

s3hub rm ${YOUR_BUCKET_NAME}/*

Delete a bucket with objects

When the number of S3 objects is large, we parallelize the deletion process to enhance speed.

s3hub rm --recursive ${YOUR_BUCKET_NAME}

delete_bucket