AWS S3 CLI CP file and add metadata

Indeed the support for metadata option has been added since 1.9.10

aws s3 Added support for custom metadata in cp, mv, and sync.

so upgrading your aws cli to this version (or even better to latest) - and the metadata value needs to be a map so

aws s3 cp test.txt s3://a-bucket/test.txt --metadata '{"x-amz-meta-cms-id":"34533452"}'

Install s3cmd tools (free) and invoke like so:

s3cmd modify --add-header x-amz-meta-foo:bar s3://<bucket>/<object>

With x-amz-meta-foo:bar header you will get foo as key and bar as value of that key.