Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Ruby library and command line tool for accessing DreamHost's API
tag: v0.2.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

What is it?

Dreamy is Ruby library and command line tool for interfacing with DreamHost's API. The API itself is still very young so this is by no means a comprehensive library. Please fork and contribute!


Grab the gem from GitHub

gem sources -a
gem install sant0sk1-dreamy

Library Usage

DreamHost requires a username (email or webID) and API key (available from your DH Panel) to make API requests. When creating a Dreamy instance you'll need to provide this data. The Dreamy command line tool (dh) gathers the necessary info from a configuration file or environment variables, but you can do it however you'd like.

To get started with the library, just require the gem:

require 'rubygems'
require 'dreamy'

Create a new object using your username and API key.

account =,api_key)

Fetch an array of Dreamy::Domain objects:

Now that you have an array you can have your way with the data: do |d|
  puts d.home
  puts d.user
  puts d.www_or_not

Same goes with Users, DNS records and announcement list subscribers

# fetch an array of Dreamy::User objects

# fetch an array of Dreamy::Dns objects

# fetch an array of Dreamy::Subscribers to an announcement list

You can interact with announcement lists by adding and removing subscribers

# add a new subscriber to an announcement list

# remove a subscriber from an announcement list

More and more functions will be added as time allows. If there's something missing that you want in, please:

fork -> commit -> pull request

Command Line Usage

The Dreamy gem will install an executable called "dh". In order to use it, you'll need to set your DreamHost account username and API key. You can acquire an API key from the DreamHost panel. "dh" will fetch your API credentials from 2 places, respectively:

1) A file called .dreamyrc in your $HOME directory with username on line 1, api key on line 2

An example ~/.dreamyrc would look like:

2) Environment variables DH_USER and DH_KEY. You can set these by typing this in your shell:


If you want to make those environment variables permanent, add those 2 lines to the bottom of your ~/.bashrc

Run this from the command line to print the usage:

dh help

=== Commands
 help                           # show this usage

 domains                        # list domains: details
 domains:status                 # check availability of all domains (pingability)

 dns                            # list DNS records
 dns <name>                     # list DNS records for <name>

 announce:list <list>           # lists all subscribers to <name> list (eg - '')
 announce:add <list> <email>    # add subscriber with <email> to <list>
 announce:remove <list> <email> # remove subscriber with <email> from <list>

 users                          # list user accounts: details
 users:pw                       # list user accounts: usernames & passwords

That's it for now. New commands should be springing up as Dreamy and the DreamHost API mature!


  • more tests
  • add real rdocs
Something went wrong with that request. Please try again.