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 doctl. Commonly queried resources include:

  • Droplets (virtual machines)
  • Kubernetes clusters (DOKS)
  • App Platform applications
  • Managed Databases
  • Load Balancers
  • Volumes and Snapshots
  • Domains and DNS records
  • Container Registry
  • Spaces (object storage)
  • Firewalls
  • VPCs

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"