Skip to main content

AWS CLI

The AWS CLI works with Fil One out of the box. Install it, configure your credentials, and use --endpoint-url https://<region>.s3.filonecontent.com on every command — or set it as a profile default so you never have to type it.

The endpoint depends on your bucket's region

Examples here use eu-west-1, the default region. For a bucket in us-east-1, use https://us-east-1.s3.filonecontent.com and region us-east-1. The endpoint, the region, and your access key must all refer to the same region — set up one profile per region if you use both.

Installation

Use AWS CLI v2. Version 1 (pip install awscli) does not read endpoint_url from ~/.aws/config, so the profile setup below silently won't work — install v2 instead:

brew install awscli
# or follow the official installer for your platform:
# https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Confirm you have v2:

aws --version   # should print aws-cli/2.x

Configuration

Add a filone profile to your AWS config files so you don't have to pass --endpoint-url on every command:

# ~/.aws/config
[profile filone]
endpoint_url = https://eu-west-1.s3.filonecontent.com
region = eu-west-1
s3 =
addressing_style = path

The addressing_style = path line is required: Fil One only supports path-style URLs, and the CLI defaults to virtual-hosted style even with a custom endpoint, which fails with a DNS or 404-shaped error.

# ~/.aws/credentials
[filone]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY

Then use --profile filone (or AWS_PROFILE=filone) on every command:

aws s3 ls --profile filone

Or set it for your shell session:

export AWS_PROFILE=filone
aws s3 ls

Option 2: Default profile with env vars

export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
export AWS_DEFAULT_REGION=eu-west-1

There is no environment variable for addressing style, so set path-style once in your config (it applies to the default profile):

aws configure set default.s3.addressing_style path

Then pass --endpoint-url on each command:

aws s3 ls --endpoint-url https://eu-west-1.s3.filonecontent.com

Core operations

Create a bucket

CreateBucket is region-dependent. It is not available in eu-west-1 — use the Fil One dashboard there, via Buckets → Create bucket. In us-east-1, with a key that has the CreateBucket permission:

aws s3 mb s3://my-bucket --profile filone

Note that versioning and Object Lock can only be set when the bucket is created, and only from the dashboard. See Buckets.

Upload a file

aws s3 cp report.pdf s3://my-bucket/reports/report.pdf --profile filone

Upload a directory

aws s3 sync ./local-folder s3://my-bucket/folder/ --profile filone

List objects

aws s3 ls s3://my-bucket/ --profile filone
# Recursive listing with sizes
aws s3 ls s3://my-bucket/ --recursive --human-readable --profile filone

Download a file

aws s3 cp s3://my-bucket/reports/report.pdf ./report.pdf --profile filone

Download a directory

aws s3 sync s3://my-bucket/folder/ ./local-folder --profile filone

Delete an object

aws s3 rm s3://my-bucket/reports/report.pdf --profile filone

Delete a bucket

DeleteBucket support depends on the region. In us-east-1 you can remove an empty bucket with a key that has the DeleteBucket permission:

aws s3 rb s3://my-bucket --profile filone

In eu-west-1 the operation is not available, and dashboard deletion is not yet enabled either. See Buckets.

Multipart uploads

The AWS CLI handles multipart uploads automatically. You can configure the threshold:

# Set multipart threshold to 100 MB (default is 8 MB)
# Note: use the bare "s3." key with --profile; the "default." prefix is only for the default profile
aws configure set s3.multipart_threshold 100MB --profile filone
aws configure set s3.multipart_chunksize 50MB --profile filone

Cleanup incomplete multipart uploads

# List incomplete uploads
aws s3api list-multipart-uploads --bucket my-bucket --profile filone

# Abort a specific incomplete upload
aws s3api abort-multipart-upload \
--bucket my-bucket \
--key large-file.zip \
--upload-id YOUR_UPLOAD_ID \
--profile filone

See the S3 Compatibility Reference for the full list of supported operations.