Edit files directly on Amazon S3 in CLI
Directly inspired by s3-edit written in Go by tsub.
For macOS(ARM and Intel) and Linux(coming soon)
$ brew install joegiralt/ex-s3-edit/ex-s3-edit
Download latest binary from https://github.com/joegiralt/ex-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.
$ ex_s3_edit --edit s3://mybucket/myfile.txt
Then a file will open with the default editor specified by $EDITOR
or EDITOR
.
To view a list of all files in S3, use --list
subcommand.
$ ex_s3_edit --list
To view the contents of a specific file in S3, use --read
subcommand.
$ ex_s3_edit --read s3://mybucket/myfile.txt
- Elixir >= 1.12.3
- Erlang >= 24.1.3
$ iex -S mix run --no-start
$ mix test --no-start
$ mix release