A Handy S3 CLI

Do you ever get annoyed that you have to install Python, pip, and then AWS CLI in order to simply access your S3 storage to manage your buckets?

I know once in a while, I do.

Then this awesome guy, James Hunt, showed me a handy tool S3 CLI he wrote. It is simple, but gets the job done. It supports list buckets, create/delete buckets, upload/delete files, etc.

Go here to download the binary for your OS, name it s3, change the permission, and put in your PATH. It is even cooler that s3 is avaiable through homebrew. Simply run the following commands:

brew tap jhunt/hacks
brew install s3

You can run basic s3 commands to see all the commands now.

General usage: s3 COMMAND [OPTIONS...]
  acls            List known ACLs and their purposes / access rules.
  commands        List known sub-commands of this s3 client.
  list-buckets    List all S3 buckets owned by you.
  create-bucket   Create a new bucket.
  delete-bucket   Delete an empty bucket.
  put             Upload a new file to S3.
  get             Download a file from S3.
  cat             Print the contents of a file in S3.
  url             Print the HTTPS URL for a file in S3.
  rm              Delete file from a bucket.
  ls              List the files in a bucket.
  chacl           Change the ACL on a bucket or a file.
  lsacl           List the ACL on a bucket or a file.

To access your Amazon S3, you can set up the following environment variables.

S3_AKI: Your Access Key ID.
S3_KEY: Your secret access key.
S3_REGION: The name of the AWS region.

If you are looking for more complicated operations in your Amazon S3 and other cloud storage service providers that use the S3 protocol, such as Google Cloud Storage or DreamHost DreamObjects, check s3cmd out.

Spread the word

twitter icon facebook icon linkedin icon