/pearl

Command line interface for Digital Ocean's API

Primary LanguageRubyMIT LicenseMIT

Pearl

Pearl is a command line interface to DigitlOcean's API.

Setup

Run the following command to install

$ gem install pearl

Add your client id and api key as enviroment variables

ENV['DIGITAL_OCEAN_CLIENT_ID']
ENV['DIGITAL_OCEAN_API_KEY']

Usage

Droplets

To see all your droplets

$ pearl droplets

To view a droplet

$ pearl droplet -d <droplet id>

To create a droplet

$ pearl droplet add <name> --size <size id> --image <image id> --region <region id> --ssh_key_ids <ssh key ids>

or

$ pearl droplet add <name> -s <size id> -i <image id> -r <region id> -k <ssh key ids>

Reboot a droplet

$ pearl droplet reboot -d <droplet id>

Power cycle droplet

$ pearl droplet power cycle -d <droplet id>

Shutdown droplet

$ pearl droplet shutdown -d <droplet id>

Power Off droplet

$ pearl droplet power off -d <droplet id>

Power On droplet

$ pearl droplet power on -d <droplet id>

Reset root password

$ pearl droplet password reset -d <droplet id>

Resize droplet

$ pearl droplet resize -d <droplet id> -s <size id>

Take a snapshot

$ pearl droplet snapshot <snapshot name> -d <droplet id>

Restore droplet

$ pearl droplet restore -d <droplet id> -i <image id>

Rebuild droplet

$ pearl droplet rebuild -d <droplet id> -i <image id>

Enable automatic backups

$ pearl droplet enable backups -d <droplet id>

Disable automatic backups

$ pearl droplet disable backups -d <droplet id>

Rename droplet

$ pearl droplet rename <name> -d <droplet id>

Destroy droplet

$ pearl droplet destroy -d <droplet id>

Regions

Display regions

$ pearl regions

Sizes

Display regions

  $ pearl sizes

Images

Display all images

$ pearl images

To display your images

$ pearl images my

To display global images (default)

$ pearl images global

View a single image

$ pearl image -i <image id>

To destroy an image

$ pearl image destroy -i <image id>

To transfer an image

$ pearl image transfer -i <image id> -r <region id>

SSH Keys

Display all ssh keys

$ pearl ssh_keys

Add a ssh key

$ pearl ssh_key add <name> -p <public ssh key>

To view a ssh key

$ pearl ssh_key -k <ssh key id>

To delete a ssh key

$ pearl ssh_key destroy -k <ssh key id>

TODO

  • Format output instead of just printing the json response.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request