Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
cf -- A command line client to Rackspace Cloud Files
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
.gitignore
LICENSE
README.md
setup.py

README.md

WARNING

Do yourself a favor - use a project that is well maintained and loved, rather than this languishing tool. There are now many projects that are far superior and far better maintained than cf. I personally like Swiftly and Posthaste. The former is written by an original, core dev on Swift, and the latter is one to which I've contributed. You may find one of them matches your use case.

cf

A Command-Line Interface to Rackspace Cloud Files

It's not beautiful, or amazing, or even spectacular. But it will will let you upload stuff to Cloud Files hosted in Rackspace. Simple commands like cf list all or cf put somecontainer file1 file2 don't suck too bad, right? So far, you can:

  • List containers
  • List objects in containers
  • Create and delete containers
  • Delete, upload, and download objects

In the future, I hope it'll also:

  • Delete containers w/ objects (override default safeties)
  • Make containers public and get URLs
  • Shorten CDN URLs for public files
  • Enable CDN logging
  • Modify CDN TTL vals

Installation

With pip or easy_install:

$ sudo pip install cf
OR
$ sudo easy_install cf

With git:

$ git clone https://github.com/angstwad/cf.git
$ cd cf/
$ sudo python ./setup.py install

Requires

python-cloudfiles

The setup.py script will attempt to download and install the python-cloudfiles module for you, but if it doesn't, then you'll have to manually install it:

$ sudo pip install python-cloudfiles
OR
$ sudo easy_install python-cloudfiles

Usage

Credentials (username and API key) are supplied three ways:

  • Arguments: $ cf --username <username> --apikey <apikey>
  • Environment variables: CF_USER and CF_APIKEY
  • Config file at $HOME/.cf, created by running $ cf config --create-config

Credentials supplied as arguments override a config file or enviroment variables -- in fact, they're prioritized in the order above. Arguments > envvars > config file.

Test your credentials:
$ cf config --test-login
>>> Successfully authenticated to Rackspace Cloud Files.
List all containers

$ cf list all

List all items in mycontainer:

$ cf list mycontainer

Create container:

$ cf cont --create someContainer

Delete container:

$ cf cont [ --delete | -D ] someContainer

Upload some files:

$ cf put new_container file1 file2

Upload whole dirs:

$ cf put someContainer ~/Documents/*

Download some files:

$ cf get that_old_container pic1.jpg file2.html

Or put it someplace special with the -d flag!

$ cf get that_old_container pic1.jpg file2.html -d /home/user

Delete remote objects

$ cf obj someContainer [ --delete | -d ] file1 file2

Info

  • It does now check for overwrites!
  • Haven't tested on Windows. I don't even have a clue if it'll work for you.

License

Released under the Apache 2.0 license.

Something went wrong with that request. Please try again.