Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsub/s3-edit
Edit directly a file on Amazon S3 in CLI
https://github.com/tsub/s3-edit
aws aws-s3 cli go golang s3
Last synced: 3 months ago
JSON representation
Edit directly a file on Amazon S3 in CLI
- Host: GitHub
- URL: https://github.com/tsub/s3-edit
- Owner: tsub
- License: mit
- Created: 2017-08-23T13:37:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T07:26:49.000Z (about 2 years ago)
- Last Synced: 2024-06-20T00:35:21.512Z (5 months ago)
- Topics: aws, aws-s3, cli, go, golang, s3
- Language: Go
- Homepage:
- Size: 72.3 KB
- Stars: 77
- Watchers: 6
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s3-edit
Edit directly a file on Amazon S3 in CLI.
[![GitHub release](https://img.shields.io/github/release/tsub/s3-edit.svg?style=flat-square)](https://github.com/tsub/s3-edit/releases)
[![CircleCI branch](https://img.shields.io/circleci/project/github/tsub/s3-edit/master.svg?style=flat-square)](https://circleci.com/gh/tsub/s3-edit/tree/master)
[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/tsub/s3-edit)
[![MIT license](https://img.shields.io/github/license/tsub/s3-edit.svg?style=flat-square)](https://github.com/tsub/s3-edit/blob/master/LICENSE)## Installation
### Use go get
```
$ go get -u github.com/tsub/s3-edit
```### Install with Homebrew
For macOS and Linux
```
$ brew install tsub/s3-edit/s3-edit
```### Get binary from GitHub releases
Download latest binary from https://github.com/tsub/s3-edit/releases
## Requirements
* AWS credentials
* Upload files to S3 in advanceFor 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
```## 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`.
[![https://gyazo.com/96c9225da700f91e7b44c04f439fdd23](https://i.gyazo.com/96c9225da700f91e7b44c04f439fdd23.png)](https://gyazo.com/96c9225da700f91e7b44c04f439fdd23)
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.
```## Development
### Requirements
* Golang >= 1.17