A set of tools to interact with buckets from the command line.
Available commands are as follows:
lb
: list bucketsls
: list objects in a bucketlsv
: list object versions in a version-enabled bucketrm
: remove an object (adding a delete marker in a version-enabled bucket)rmv
: remove an object version, or remove all object versions
Install this using npm install -g CodeNow/s3-tools
. For this command to work, you need to have S3TOOLS_AWS_ACCESS_KEY
and S3TOOLS_AWS_SECRET_KEY
set in your environment with your valid credentials.
For ls
, lv
, rm
, and rmv
, there are options that you can and need to pass along:
--bucket BUCKET_NAME
: name of the bucket to work with--prefix PREFIX
: prefix if you want to specify what subset of objects you want to work with--delimiter DELIMITER
: delimiter if you want to break the keys down (for example, by 'folders' would use the delimiter/
)--key KEY
: key of an individual object to list--rmv-all
: remove all versions of the object(s)
s3-tools lb
s3-tools ls --bucket BUCKET_NAME
s3-tools ls --bucket BUCKET_NAME --delimiter /
s3-tools lsv --bucket BUCKET_NAME
s3-tools lsv --bucket BUCKET_NAME --key OBJECT_KEY
s3-tools rm --bucket BUCKET_NAME
s3-tools rmv --rmv-all --bucket BUCKET_NAME --key OBJECT_KEY
s3-tools rmv --bucket BUCKET_NAME --key OBJECT_KEY