Edit directly a file on Amazon S3 in CLI.
$ go get -u github.com/tsub/s3-edit
For macOS and Linux
$ brew install tsub/s3-edit/s3-edit
Download latest binary from https://github.com/tsub/s3-edit/releases
- AWS credentials
- Upload files to S3 in advance
For examples, use aws-cli
$ aws configure --profile myaccount
$ export AWS_PROFILE=myaccount
Other methods,
$ export AWS_ACCESS_KEY_ID=xxxx
$ export AWS_SECRET_ACCESS_KEY=xxxx
$ export AWS_REGION=ap-northeast-1
Upload the file to S3 in advance.
$ echo "This is a test file." > myfile.txt
$ aws s3 cp test.txt s3://mybucket/myfile.txt
To directly edit a file on S3, use edit
subcommand.
$ s3-edit edit s3://mybucket/myfile.txt
Then, open a file with the default editor specified by $EDITOR
.
When you close the editor after edit, a file is automatically re-uploaded to S3.
$ aws s3 cp s3://mybucket/myfile.txt -
This is a test file.
Edited with s3-edit.
- Golang >= 1.17