-
Notifications
You must be signed in to change notification settings - Fork 2
All S3 related actions support alternate profile but not region due to S3 being a "global" service. You could either configure them through the fzfaws.yml config file or you could pass in command line options. The command line option take higher precedence and will override the config file settings. For more information about priority, checkout here.
fzfaws s3 upload --profile rootConfigure fzfaws.yml to set default profile for all S3 actions, this will override the global settings of profile. In the example below, the default profile will be used for all other services, but S3 service will use the root profile by default.
global:
profile: default
region: us-east-1
services:
s3:
profile: rootReference individual option flag through fzfaws s3 upload --help.
Without any arguments:
- Select files from current directory (support multi selection)
- Select a bucket
- Select a path in bucket
- Files will be uploaded to the selected bucket path
fzfaws s3 uploadTo list files from home directory, you could use the --root flag. Note: it is extremely slow and resource intensive
if you don't have fd installed to search from home directory, install fd before using
this flag.
When using fd, you can also include the --hideen flag to include searching for hidden files.
fzfaws s3 upload --root --hiddenfzfaws support configuration of object settings during upload, you can configure: ACL, StorageClass, Encryption,
Tags, Metadata. A menu will be prompt to ask you which options you want to configure, use TAB to multi select.
The --extra as in extra settings, the naming could probably be better...
fzfaws s3 upload --extraThe demo below demonstrates an upload operation to S3 bucket, uploading hidden files from home directory,
the preview window on the right list the objects in the current S3 path.

Directories does not allow multi selections, if you wish to upload or configure multiple directories at once, use --exclude
and --include globbing to achieve it.
To upload an entire directory, same as aws-cli, you will need to pass in the --recursive flag to indicate
a recursive operation. fzfaws also provides --exclude and --include flag for some extra filtering capabilities.
Both of them takes a number of bash globbing pattern, and --exclude will always be processed before --include.
When using --recursive together with --extra flag, the extra configuration applies to all files uploaded (i.e. if you set a different StorageClass, all items in the folder gets that StorageClass)
# just upload a directory
fzfaws s3 upload --recursive
# Uploading the current directory to S3 bucket, but we don't want to upload the .git folder
fzfaws s3 upload --recursive --path $PWD/ --exclude ".git/*"
# Only upload the "fooboo" and "helloworld" directory under current directory
fzfaws s3 upload --recursive --path $PWD/ --exclude "*" --include "fooboo/*" "helloworld/*"If you have aws-cli installed, you could use the --sync flag to leverage it's sync functionality. The --exclude
and --include flag also applies it's functionality during sync.
# select a directory through fzf and sync the directory with a S3 bucket without the .git folder
fzfaws s3 upload --sync --exclude ".git/*"Reference individual option flag through fzfaws s3 download --help.
Without any arguments:
- Select a bucket
- Select objects (support multi selection)
- Select a download location under current directory
- Objects will be downloaded to the selected location
fzfaws s3 downloadTo select a location for download from the home directory, use the --root flag. Note: it is extremely slow and resource intensive
if you don't have fd installed to search from home directory, install fd before using
this flag.
When using fd, you can also include the --hideen flag to include searching for hidden files.
fzfaws s3 download --root --hiddenYou can also download versions of an object in S3 buckets that has versioning turned on. This flag does not work with
--recursive flag. The red colored item are the item with "delete marker" associated. Versions supports multi selection.
fzfaws s3 download --versionDownloading directories have the same mechanics as uploading directories, using --recursive flag while also
support --exclude, --include and --sync flag, consult directories section in #uploading-files-to-s3.
The demo below demonstrates a recursive download operation to a folder under current directory, the
preview window on the right list the objects in the current S3 path.

Reference individual option flag through fzfaws s3 bucket --help.
Without any arguments:
- Select a source bucket
- Select source objects (support multi selection)
- Select destination bucket
- Select destination path
- Objects will be transferred
fzfaws s3 bucketYou can also transfer versions of an object between S3 buckets if the source bucket has versioning turned on. This flag does not work with
--recursive flag. The red colored item are the item with "delete marker" associated. Versions supports multi selection.
fzfaws s3 bucket --versionBy default, when objects are moved to other buckets, other buckets settings will apply to the object. Optionally, you could also choose to preserve all objects details when transferring, including ACL, StorageClass, Encryption, Metadata, Tags.
Note: --preserve does support cross region transfer, however if you are using KMS encryption, it will fall back to SSE-S3 encryption.
fzfaws s3 bucket --preserveTransferring recursively have the same mechanics as uploading directories, using --recursive flag while also
support --exclude, --include and --sync flag, consult directories section in #uploading-files-to-s3.
Reference individual option flag through fzfaws s3 object --help.
You could use fzfaws to update most of the objects details. The supported attributes by default are: ACL, StorageClass, Encryption, Metadata, Tags.
Without any arguments:
- Select a bucket
- Select objects to update (support multi selection)
- Select which attributes to update (support multi selection)
- Going through each of the selected attributes and input their new value
- Objects will be updated
fzfaws s3 objectYou also update the name of an object. This will preserve all objects details comparing to a normal aws s3 cp s3://bucket1/oldename s3://bucket1/newname.
fzfaws s3 object --nameYou can also configure specific versions attributes of an object. With --version flag, the available attributes for update will be limited to
Tags and ACL because updating all other attributes will create a new version.
fzfaws s3 object --version
# updating attributes of all versions
fzfaws s3 object --allversionOperating on versioning enabled bucket it is recommended to always use the --version flag even if you just want to update the latest
version attributes. Because updating a versioned objects StorageClass, Encryption and Metadata will always create a new version. Using the --version
flag will limit the default menu to only show Tags and ACL.
It is also not recommended to update name of on versioning enabled buckets because it doesn't really rename, it will just create a new object with the new name and leaving the old objects and it's versions associated with a delete marker.
You can recursively update attributes of an entire "folder"(common prefix), same as uploading directories to S3, it takes
--exclude and --include for extra filtering.
fzfaws s3 object --recursiveReference individual option flag through fzfaws s3 delete --help.
Without any arguments:
- Select a bucket
- Select objects to delete (support multi selection)
- Objects will be deleted
If versioning is enabled, a delete marker will be associated.
fzfaws s3 deleteYou can recursively delete objects of an entire "folder"(common prefix), same as uploading directories to S3, it takes
--exclude and --include for extra filtering.
fzfaws s3 delete --recursivefzfaws provides a few useful commands to handle deletion of versioned objects. The red colored objects
are objects with delete marker associated.
When deleting a versioned objects, only a delete marker is associated with the object, we are not really deleting the objects. Commands below will delete the selected version instead of associating a delete marker, you can even delete a delete marker. Support multi selection on versions.
fzfaws s3 delete --versionYou can run a clean up commands to delete all older versions of an object, meaning that only the latest version will be retained.
The --version flag is optional here as --clean will automatically apply --version.
fzfaws s3 delete --clean
# You could even do it recursively
fzfaws s3 delete --clean --recursiveYou can also cleanly delete a versioned object, meaning delete all versions including the current version.
The --version flag is optional here as --allversion will automatically apply --version.
fzfaws s3 delete --allversion
# You could even use this to nuke an entire versioned bucket
fzfaws s3 delete --allversion --recursiveYou could also delete objects from MFA protected bucket.
fzfaws s3 delete --mfa [device serial number] [the MFA 4 digit code]The above operation doesn't support any type of multiple operations because the MFA code expires after first operation.
Reference individual option flag through fzfaws s3 presign --help.
Without any arguments:
- Select a bucket
- Select objects (support multi selection)
- A presign GET URL will be generated with 3600 seconds of expiration
fzfaws s3 presignEdit the fzfaws.yml config file to set a different default expiration.
services:
s3:
default_args:
presign: --expires 7200You can also generate presign GET URL for versions of objects. Support multi select on versions.
fzfaws s3 presign --versionCheckout the dedicated section for extending fzfaws functionalities which explains how and why for the ls commands. The ls command will just print out information without doing any actions. Consult the help manual to see the available options.
fzfaws s3 ls --helpSometimes if you remember a partial part of the objects path and its relatively short, it may be beneficial to skip some fzf prompt to speed things up a little bit.
The format is a bit strict:
- Specify just the bucket:
fzfaws s3 upload --bucketpath bucket1/ - Specify a "folder" in S3:
fzfaws s3 download --bucketpath bucket1/folder1/ - Specify a object in S3:
fzfaws s3 bucket --bucketpath bucket1/object
This --bucketpath applies to all operations that contains the --bucketpath flag not just fzfaws s3 bucket exclusively. If you wish to use a S3 access point,
you will have to use the --bucketpath flag, fzfaws s3 bucket --bucketpath accesspoint/.
fzfaws s3 bucket --bucketpath bucket1/hello.txt --to bucket2/Same applies to local file/directory path, you can use the --path to specify local file path. This is especially useful if you are using fd, sometimes you may
want to upload a file type that is ignored by .ignore and during the file listing you couldn't find the file to upload.
fzfaws s3 upload --path foo.png hello.jpeg lol.txt