Digital Ocean Wrench
Complete CLI to the Digital Ocean API
Installation
npm install -g dow
dow
will look for a DIGITALOCEAN_ACCESS_TOKEN
environment variable. You can create one here, and surface it by adding the following to your .profile
/.bash_profile
/etc.:
export DIGITALOCEAN_ACCESS_TOKEN="<your-access-token>"
If you really want, you can additionally pass your token via the --token
flag (see special flags). Read here about how to keep such commands out of your history.
Usage
For now, the tool will pretty much explain how to use it. (Methods map pretty simply to the official documentation.) Top-level lists categories:
$ dow usage: dow <command> where <command> is one of: actions domains domain-records droplets images ssh-keys regions sizes floating-ips
Categories list methods:
$ dow images usage: dow images <method> where <method> is one of: listget-by-idget-by-sluglist-actionsupdatedeletetransferconvert-to-snapshotget-action
And methods explain themselves when misused:
$ dow images get-by-slug usage: dow images get-by-slug <image-id>
or
$ dow droplet create usage: dow droplets create --name=<value> --region=<value> --size=<value> --image=<value> [--ssh_keys=<value-1>,<value-2>,...] [--backups=<value>] [--ipv6=<value>] [--private_networking=<value>] [--user_data=<value>]
Output tries to be common sense, but log is far from complete. You can use --raw
to get just the JSON response. The JSON combined with a command-line JSON manipulator like json give you plenty of flexibility. See the cookbook for some examples.
Special flags
Special Flag | Explanation |
---|---|
--raw |
Only write out Digital Ocean's JSON response |
--token=<token> |
Manually provide access token |
--no-wait |
Do not wait for actions to move out of 'in-progress' status or for droplets to move out of 'new' status. Without --no-wait , dow will poll new actions and droplets until they reach a resolution. |
--no-spin |
Do not show a spinner |
--page=<page #> |
Request an individual page of results (useful for actions + images, and maybe more) |
--force |
Skip confirmation of DELETE methods |