← Back to tools
View AGENTS.md for DigitalOcean CLI
DigitalOcean CLI
Official command-line interface for DigitalOcean
Description
doctl is the official DigitalOcean command-line client. It provides access to DigitalOcean's API to manage Droplets, Kubernetes clusters, databases, spaces, load balancers, domains, and other infrastructure resources directly from the terminal.
Install
homebrew
brew install doctlsnap
sudo snap install doctlAI Summary
Official DigitalOcean CLI. Manage Droplets, Kubernetes clusters, managed databases, Spaces object storage, App Platform deployments, and all DigitalOcean resources from the terminal.
Capabilities
- + Create, resize, and manage Droplets (VMs)
- + Provision and manage Kubernetes clusters (DOKS)
- + Deploy applications to DigitalOcean App Platform
- + Manage Spaces object storage (S3-compatible)
- + Configure load balancers, firewalls, and networking
- + Manage managed databases (Postgres, MySQL, Redis)
Use When
- → Managing DigitalOcean infrastructure from the terminal
- → Deploying applications to DigitalOcean App Platform
- → Provisioning Droplets or Kubernetes clusters via scripts
- → Automating DigitalOcean workflows in CI/CD pipelines
Avoid When
- x Managing non-DigitalOcean cloud resources (use aws-cli, gcloud, az)
- x Need multi-cloud infrastructure management (use Terraform)
- x Complex enterprise cloud setups requiring hundreds of services
Usage Patterns
Create a Droplet
doctl compute droplet create my-server --region nyc1 --size s-1vcpu-1gb --image ubuntu-22-04-x64 --ssh-keys $(doctl compute ssh-key list --no-header --format ID) Creates a 1GB Droplet in NYC1 with Ubuntu and existing SSH keys
List Kubernetes clusters
doctl kubernetes cluster list --format Name,Region,Version,Status Lists all DOKS clusters with key details
Deploy an app
doctl apps create --spec .do/app.yaml Deploys an application to App Platform using a spec file
Input / Output
stdin: Spec files can be piped for some commands
stdout: Formatted text tables or JSON API responses
Exit codes:
0 Success 1 Error Typical Pipelines
doctl compute droplet list --format ID,Name,PublicIPv4,Status --no-header | fzf | awk '{print $3}' | xargs ssh root@ doctl kubernetes cluster kubeconfig save my-cluster && kubectl get pods doctl compute droplet list -o json | jq '.[] | select(.status=="active") | {name, ip: .networks.v4[0].ip_address}'