DevOps & CloudDocumentedScanned

digital-ocean

Manage Digital Ocean droplets, domains, and infrastructure via DO API.

Share:

Installation

npx clawhub@latest install digital-ocean

View the full skill documentation and source below.

Documentation

Digital Ocean Management

Control DO droplets, domains, and infrastructure.

Setup

Set environment variable:

  • DO_API_TOKEN: Your Digital Ocean API token (create at cloud.digitalocean.com/account/api/tokens)


CLI Commands

# Account info
uv run {baseDir}/scripts/do.py account

# List all droplets
uv run {baseDir}/scripts/do.py droplets

# Get droplet details
uv run {baseDir}/scripts/do.py droplet <droplet_id>

# List domains
uv run {baseDir}/scripts/do.py domains

# List domain records
uv run {baseDir}/scripts/do.py records <domain>

# Droplet actions
uv run {baseDir}/scripts/do.py power-off <droplet_id>
uv run {baseDir}/scripts/do.py power-on <droplet_id>
uv run {baseDir}/scripts/do.py reboot <droplet_id>

Direct API (curl)

List Droplets

curl -s -H "Authorization: Bearer $DO_API_TOKEN" \
  "" | jq '.droplets[] | {id, name, status, ip: .networks.v4[0].ip_address}'

Get Account Info

curl -s -H "Authorization: Bearer $DO_API_TOKEN" \
  "" | jq '.account'

List Domains

curl -s -H "Authorization: Bearer $DO_API_TOKEN" \
  "" | jq '.domains[].name'

Create Droplet

curl -s -X POST -H "Authorization: Bearer $DO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-droplet",
    "region": "nyc1",
    "size": "s-1vcpu-1gb",
    "image": "ubuntu-22-04-x64"
  }' \
  ""

Reboot Droplet

curl -s -X POST -H "Authorization: Bearer $DO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"type":"reboot"}' \
  ""

Add Domain

curl -s -X POST -H "Authorization: Bearer $DO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "example.com"}' \
  ""

Notes

  • Always confirm before destructive actions (power-off, destroy)
  • Token requires read/write scope for management actions
  • API docs: