🚚 ☁️ Object Store Manipulator - curl for cloud storage
Clone or download
Failed to load latest commit information.
hack Prepare docs for 0.8.0 release (#36) Sep 13, 2018
vendor Support Kubernetes 1.12 (#37) Oct 13, 2018
.gitignore Add travis yaml (#24) Mar 15, 2018
.travis.yml Add travis yaml (#24) Mar 15, 2018
CONTRIBUTING.md Add dev docs. (#9) Aug 17, 2017
LICENSE Initial commit Oct 26, 2016
README.md Prepare docs for 0.8.0 release (#36) Sep 13, 2018
glide.yaml Support Kubernetes 1.12 (#37) Oct 13, 2018
main.go Remove pkg package. (#10) Aug 17, 2017


Go Report Card Build Status codecov Docker Pulls Slack Twitter


Object Store Manipulator (osm: pronounced like awesome) - curl for cloud storage services. πŸ™Œ osm can create & delete buckets and upload, download & delete files from buckets for AWS S3, AWS S3 compatible other storage services(i.e. Minio), DigitalOcean Spaces, Google Cloud Storage, Microsoft Azure storage and OpenStack Swift. Its single binary can be easily packaged instead of official python based clis inside Docker images.

Install OSM

You can download and install a pre-built binary:

# Linux amd 64-bit:
wget -O osm https://cdn.appscode.com/binaries/osm/0.8.0/osm-linux-amd64 \
  && chmod +x osm \
  && sudo mv osm /usr/local/bin/

# Linux 386 32-bit:
wget -O osm https://cdn.appscode.com/binaries/osm/0.8.0/osm-linux-386 \
  && chmod +x osm \
  && sudo mv osm /usr/local/bin/

# Mac 64-bit
wget -O osm https://cdn.appscode.com/binaries/osm/0.8.0/osm-darwin-amd64 \
  && chmod +x osm \
  && sudo mv osm /usr/local/bin/

# Mac 32-bit
wget -O osm https://cdn.appscode.com/binaries/osm/0.8.0/osm-darwin-386 \
  && chmod +x osm \
  && sudo mv osm /usr/local/bin/

To build from source, run: go get -u github.com/appscode/osm


osm [command] [flags]
osm [command]

Available Commands:
  config      OSM configuration
  help        Help about any command
  lc          List containers
  ls          List items in a container
  mc          Make container
  pull        Pull item from container
  push        Push item to container
  rc          Remove container
  rm          Remove item from container
  stat        Stat item from container
  version     Prints binary version number.

      --alsologtostderr                  log to standard error as well as files
      --enable-analytics                 Send usage events to Google Analytics (default true)
  -h, --help                             help for osm
      --log_backtrace_at traceLocation   when logging hits line file:N, emit a stack trace (default :0)
      --log_dir string                   If non-empty, write log files in this directory
      --logtostderr                      log to standard error instead of files
      --osmconfig string                 Path to osm config (default "$HOME/.osm/config")
      --stderrthreshold severity         logs at or above this threshold go to stderr (default 2)
  -v, --v Level                          log level for V logs
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

Use "osm [command] --help" for more information about a command.

OSM Configuration

osm stores credentials necessary to connect to a cloud storage provider in YAML format in $HOME/.osm/config file. This allows providing commands one time for multiple subsequent operations with a cloud provider.

# AWS S3:
osm config set-context osm-s3 --provider=s3 --s3.access_key_id=<key_id> --s3.secret_key=<secret_key> --s3.region=us-east-1

# TLS secure Minio server
osm config set-context osm-minio --provider=s3 --s3.access_key_id=<minio_access_key> --s3.secret_key=<minio_secret_key> --s3.endpoint=<minio_server_address> --s3.cacert_file=<root_ca_file_path>

# DigitalOcean Spaces:
osm config set-context osm-do --provider=s3 --s3.access_key_id=<key_id> --s3.secret_key=<secret_key> --s3.endpoint=nyc3.digitaloceanspaces.com

# Google Cloud Storage:
osm config set-context osm-gs --provider=google --google.json_key_path=<path_sa_file> --google.project_id=<my_project>

# Microsoft Azure ARM Storage:
osm config set-context osm-az --provider=azure --azure.account=<storage_ac> --azure.key=<key>

# Local Filesystem
osm config set-context osm-local --provider=local --local.path=/tmp/stow

Bucket Operations

# create bucket
osm mc mybucket

# upload file to bucket
osm push -c mybucket ~/Downloads/appscode.pdf a/b/c.pdf

# print uploaded file attributes
osm stat -c mybucket a/b/c.pdf

# download file from bucket
osm pull -c mybucket a/b/c.pdf /tmp/d.pdf

# list bucket
osm ls mybucket

# remove file from bucket
osm rm -c mybucket a/b/c.pdf

# remove bucket (use -f to delete any files inside)
osm rc -f mybucket

Contribution guidelines

Want to help improve OSM? Please start here.


If you have any questions, file an issue or talk to us on our community Slack channel.

The osm binary collects anonymous usage statistics to help us learn how the software is being used and how we can improve it. To disable stats collection, run the operator with the flag --enable-analytics=false.