s3-edit

command module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2017 License: MIT Imports: 1 Imported by: 0

README

s3-edit

Edit directly a file on Amazon S3.

GitHub release CircleCI branch Go Documentation MIT license

Installation

Use go get
$ go get -u github.com/tsub/s3-edit
Get binary from GitHub releases

For macOS

$ VERION=0.0.4
$ curl -fSL -o s3-edit.tar.gz "https://github.com/tsub/s3-edit/releases/download/v${VERSION}/s3-edit_v${VERSION}_darwin_amd64.tar.gz"
$ tar -zxvf s3-edit.tar.gz -C /usr/local/bin
$ rm s3-edit.tar.gz

Requirements

  • AWS credentials
  • Upload files to S3 in advance

For examples, use aws-cli

$ aws configure --profile myaccount
$ export AWS_PROFILE=myaccount
$ export AWS_REGION=ap-northeast-1

Other methods,

$ export AWS_ACCESS_KEY_ID=xxxx
$ export AWS_SECRET_ACCESS_KEY=xxxx
$ export AWS_REGION=ap-northeast-1

Usage

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.

Future

  • Provide the Homebrew formula
  • Add server-side encryption option

Development

Requirements
How to setup
$ go get -u github.com/tsub/s3-edit
$ cd $GOPATH/src/github.com/tsub/s3-edit
$ dep ensure

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cli
s3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL