Skip to content

DigitalOcean ​

Clanker supports querying and managing DigitalOcean infrastructure using the doctl CLI.


Authentication ​

DigitalOcean authentication requires an API token.

Obtaining a token ​

  1. Log in to the DigitalOcean control panel.
  2. Navigate to API > Tokens/Keys.
  3. Generate a new personal access token with the required scopes.

Configuration ​

Add your API token to ~/.clanker.yaml:

yaml
digitalocean:
  api_token: "dop_v1_abc123..."

Alternatively, use an environment variable:

bash
export DO_API_TOKEN="dop_v1_abc123..."

Token resolution order ​

  1. digitalocean.api_token in the config file
  2. DO_API_TOKEN environment variable
  3. DIGITALOCEAN_ACCESS_TOKEN environment variable

Prerequisites ​

The doctl CLI must be installed and available on your PATH:

bash
# macOS
brew install doctl

# Linux (snap)
sudo snap install doctl

# Verify
doctl version

Clanker passes the API token directly to doctl via the --access-token flag, so you do not need to run doctl auth init separately.


Querying DigitalOcean ​

Explicit flag ​

bash
clanker ask --digitalocean "What Droplets are running?"

Automatic routing ​

If your question mentions DigitalOcean-specific services, Clanker routes to DigitalOcean automatically:

bash
clanker ask "List my DigitalOcean Droplets"

Supported Services ​

Clanker queries DigitalOcean services through the API and doctl. Commonly queried resources include:

  • Droplets (virtual machines)
  • Droplet autoscale pools
  • Kubernetes clusters (DOKS)
  • App Platform applications
  • Managed Databases
  • Serverless Functions and namespaces
  • Serverless inference, dedicated inference, Gradient agents, Gradient models, Gradient regions, and Gradient knowledge bases
  • Load Balancers
  • CDNs
  • Volumes and Snapshots
  • Network File Storage (NFS) shares and snapshots
  • Domains and DNS records
  • Container Registry
  • Spaces (object storage)
  • Firewalls
  • VPCs, VPC peerings, NAT gateways, partner network attachments, and BYOIP prefixes
  • Uptime checks, uptime alerts, monitoring alerts, CSPM security scans
  • Projects and project resources

Direct inventory examples:

bash
clanker do list gradient-agents --region nyc3
clanker do list dedicated-inference
clanker do list nfs
clanker do list project-resources --project-id <project-id>
clanker do list security-scans

Maker Pipeline ​

The maker feature supports DigitalOcean infrastructure provisioning:

bash
# Generate a plan
clanker ask --maker --digitalocean "Create a Droplet called web-server with 2GB RAM in nyc3"

# Apply the plan
clanker ask --apply --plan-file plan.json

Before applying DigitalOcean plans, Clanker validates API token access and checks registry push permissions if the plan involves container image operations.


Backend Credentials ​

DigitalOcean API tokens can be stored and retrieved through the Clanker backend:

bash
clanker credentials store digitalocean
clanker ask --api-key ck_live_abc123 --digitalocean "List my Droplets"