digitalocean/doctl

Go

Open original ↗

Captured source

source ↗
published May 29, 2015seen 5dcaptured 9hhttp 200method plain

digitalocean/doctl

Description: The official command line interface for the DigitalOcean API.

Language: Go

License: Apache-2.0

Stars: 3427

Forks: 463

Open issues: 136

Created: 2015-05-29T21:24:39Z

Pushed: 2026-06-10T12:41:56Z

Default branch: main

Fork: no

Archived: no

README: doctl

doctl is a command-line interface (CLI) for the DigitalOcean API.

Usage:
doctl [command]

Available Commands:
1-click Display commands that pertain to 1-click applications
account Display commands that retrieve account details
apps Display commands for working with apps
auth Display commands for authenticating doctl with an account
balance Display commands for retrieving your account balance
billing-history Display commands for retrieving your billing history
completion Modify your shell so doctl commands autocomplete with TAB
compute Display commands that manage infrastructure
databases Display commands that manage databases
help Help about any command
invoice Display commands for retrieving invoices for your account
kubernetes Displays commands to manage Kubernetes clusters and configurations
monitoring [Beta] Display commands to manage monitoring
projects Manage projects and assign resources to them
registry Display commands for working with container registries
version Show the current version
vpcs Display commands that manage VPCs

Flags:
-t, --access-token string API V2 access token
-u, --api-url string Override default API endpoint
-c, --config string Specify a custom config file (default "$HOME/.config/doctl/config.yaml")
--context string Specify a custom authentication context name
-h, --help help for doctl
-o, --output string Desired output format [text|json] (default "text")
--trace Show a log of network activity while performing a command
-v, --verbose Enable verbose output

Use "doctl [command] --help" for more information about a command.

See the full reference documentation for information about each available command.

  • [Installing doctl](#installing-doctl)
  • [Using a Package Manager (Preferred)](#using-a-package-manager-preferred)
  • [MacOS](#macos)
  • [Snap supported OS](#snap-supported-os)
  • [Use with kubectl](#use-with-kubectl)
  • [Using doctl compute ssh](#using-doctl-compute-ssh)
  • [Use with Docker](#use-with-docker)
  • [Arch Linux](#arch-linux)
  • [Fedora](#fedora)
  • [Nix supported OS](#nix-supported-os)
  • [Docker Hub](#docker-hub)
  • [Downloading a Release from GitHub](#downloading-a-release-from-github)
  • [Building with Docker](#building-with-docker)
  • [Building the Development Version from Source](#building-the-development-version-from-source)
  • [Dependencies](#dependencies)
  • [Authenticating with DigitalOcean](#authenticating-with-digitalocean)
  • [Logging into multiple DigitalOcean accounts](#logging-into-multiple-digitalocean-accounts)
  • [Configuring Default Values](#configuring-default-values)
  • [Environment Variables](#environment-variables)
  • [Enabling Shell Auto-Completion](#enabling-shell-auto-completion)
  • [Linux Auto Completion](#linux-auto-completion)
  • [MacOS](#macos-1)
  • [Uninstalling doctl](#uninstalling-doctl)
  • [Using a Package Manager](#using-a-package-manager)
  • [MacOS Uninstall](#macos-uninstall)
  • [Examples](#examples)
  • [Tutorials](#tutorials)

Installing doctl

Using a Package Manager (Preferred)

A package manager allows you to install and keep up with new doctl versions using only a few commands. Our community distributes doctl via a growing set of package managers in addition to the officially supported set listed below; chances are good a solution exists for your platform.

MacOS

Use Homebrew to install doctl on macOS:

brew install doctl

doctl is also available via MacPorts. Note that the port is community maintained and may not be on the latest version.

Snap supported OS

Use Snap on Snap-supported systems to install doctl:

sudo snap install doctl

##### Use with kubectl

Using kubectl requires the kube-config personal-files connection for doctl:

sudo snap connect doctl:kube-config

##### Using doctl compute ssh

Using doctl compute ssh requires the core ssh-keys interface:

sudo snap connect doctl:ssh-keys :ssh-keys

##### Use with Docker

Using doctl registry login requires the dot-docker personal-files connection for doctl:

sudo snap connect doctl:dot-docker

This allows doctl to add DigitalOcean container registry credentials to your Docker configuration file.

Arch Linux

doctl is available in the official Arch Linux repository:

sudo pacman -S doctl

Fedora

doctl is available in the official Fedora repository:

sudo dnf install doctl

Nix supported OS

Users of NixOS or other supported platforms may install ``doctl`` from Nixpkgs. Please note this package is also community maintained and may not be on the latest version.

Docker Hub

Containers for each release are available under the digitalocean organization on Docker Hub. Links to the containers are available in the GitHub releases.

Downloading a Release from GitHub

Visit the Releases page for the `doctl` GitHub project, and find the appropriate archive for your operating system and architecture. Download the archive from your browser or copy its URL and retrieve it to your home directory with wget or curl.

For example, with wget:

cd ~
wget https://github.com/digitalocean/doctl/releases/download/v/doctl--linux-amd64.tar.gz

Or with curl:

cd ~
curl -OL https://github.com/digitalocean/doctl/releases/download/v/doctl--linux-amd64.tar.gz

Extract the binary:

tar xf ~/doctl--linux-amd64.tar.gz

Or download and extract with this oneliner:

curl -sL https://github.com/digitalocean/doctl/releases/download/v/doctl--linux-amd64.tar.gz | tar -xzv

where ` is the full semantic version, e.g., 1.17.0`.

On Windows systems, you should be able to double-click the zip archive to extract the doctl executable.

Move the doctl binary to somewhere in your path. For…

Excerpt shown — open the source for the full document.