Skip to main content

⌨️ AWS CLI

The AWS CLI works with Lighthouse S3 unmodified — only the endpoint changes.

Setup

aws configure set aws_access_key_id YOUR_ACCESS_KEY
aws configure set aws_secret_access_key YOUR_SECRET_KEY
aws configure set default.region us-east-1

Add a small shell function so you don't repeat --endpoint-url (works in bash and zsh):

s3() { aws --endpoint-url https://s3.lighthouse.storage "$@"; }

Upload

# single file
s3 s3 cp report.pdf s3://my-bucket/reports/report.pdf

# whole directory, recursively
s3 s3 cp ./website s3://my-bucket/site/ --recursive

# sync (only changed files)
s3 s3 sync ./photos s3://my-bucket/photos/

# with content type and custom metadata
s3 s3 cp data.json s3://my-bucket/data.json \
--content-type application/json \
--metadata owner=alice,env=prod

Files above 8 MB are uploaded as multipart automatically — no flags needed.

Get the CID

s3 s3api head-object --bucket my-bucket --key reports/report.pdf \
--query 'Metadata.cid' --output text

Other common operations

s3 s3 ls s3://my-bucket/                # list
s3 s3 cp s3://my-bucket/a.txt ./a.txt # download
s3 s3 presign s3://my-bucket/a.txt --expires-in 3600 # shareable link
s3 s3 rm s3://my-bucket/a.txt # delete (see S3 & IPFS semantics)
s3 s3 rb s3://my-bucket # remove empty bucket
note

If you see Found invalid choice '--endpoint-url ...', your shell passed the flag as one word — use the function form above rather than an $EP variable (zsh doesn't word-split variables).