A simple CLI tool to manage S3 buckets and files from the terminal
- Clone this repository
a.
git clone https://github.com/0x5b62656e5d/s3-cli
orgh repo clone 0x5b62656e5d/s3-cli
- Install the binary to path
a.
cargo install --path .
This tool requires API keys acquired from a S3 service. API keys must be granted Admin Read & Write
in order for bucket and file management to work properly.
Create a config.toml
file under ~/.config/s3-cli/
Configuration template:
[default]
key_id = "Key ID"
secret_key = "Secret Key"
endpoint_url = "Endpoint URL"
Note
If AWS S3 is being used, make sure to leave endpoint_url
blank. endpoint_url
is only required for non-AWS S3 users.
NAME
s3-cli - Manages S3 buckets and files
COMMANDS
init
Initilizes and builds a local map of buckets and their regions for faster access
buckets list
Lists buckets associated with the S3 account
buckets create <bucket_name> <bucket_region>
Creates a bucket
buckets delete <bucket_name>
Deletes a bucket
files list <bucket_name>
Lists all the files in a bucket
files delete <bucket_name> <file_name> [-f | --force]
Deletes a file in a bucket
Apply the `-f` or `--force` flag to delete all versions of a file (Not supported for R2)
files download <bucket_name> <file_key> <download_location> [-o <override_downloaded_filename>]
Downloads a file from a bucket to a given location (optionally rename it)
files upload <bucket_name> <file_location> [-o <override_uploaded_filename>]
Uploads a file into a bucket (optionally rename it)