I just released a new gem on RubyForge: cliaws. Using it, you have access to nice command line shortcuts:

1
2
3
4
5
6
$ AWS_ACCESS_KEY_ID=<your access key>
$ AWS_SECRET_ACCESS_KEY="<the secret access key>"
$ clis3 list BUCKET/PATH-PREFIX
$ clis3 put BUCKET/FULL/PATH/NAME /path/to/local/file
$ clis3 get BUCKET/FULL/PATH/NAME /path/to/local/file
$ clis3 cat BUCKET/FULL/PATH/NAME

This is not rocket science, but with the kind of work I’m doing at the moment, having quick command-line access to S3 is a boon.

Installation

1
$ gem install cliaws

Direct-code access

1
2
3
4
5
6
7
8
9
10
11
12
13
require "rubygems"
require "cliaws"

# Retrieve and store in a variable
value = Cliaws.s3.get("BUCKET/FULL/PATH/NAME")

# Retrieve and stream to specified file
File.open("/path/to/local/file", "w") do |f|
  Cliaws.s3.get("BUCKET/FULL/PATH/NAME", f)
end

# Returns an Array of full names
contents = Cliaws.s3.list("BUCKET")

Repository

The repository is hosted on GitHub, with a mirror on RubyForge.

The repository’s URLs are:

Go forth and fork !

1 Response to “Cliaws: command-line access to S3”

  1. Daniel Haran Says:

    That looks like a much saner interface than the one we’re currently using. Thanks!

Leave a Reply

 

Search

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(3) (1) (0) (2) (1) (1) (2) (2) (1) (2) (1) (2) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (2) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (2) (1) (3) (2) (8) (8) (9) (12) (1) (1) (3) (1) (1) (1) (1) (1) (1) (2) (2) (2) (1) (1) (3) (1) (3) (1) (0) (23) (1) (1) (0) (1) (1) (1) (23) (25) (1) (1) (13) (1) (1) (2) (3) (1) (1) (4) (1) (2) (3) (0) (1) (7) (3) (1) (5) (5) (2) (2) (2) (4) (6) (7) (1) (0) (1) (1) (2) (2) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives