doctl-auth

manage DigitalOcean CLI authentication contexts

TLDR

Initialize authentication
$ doctl auth init
Initialize with token directly
$ doctl auth init --access-token [token]
List auth contexts
$ doctl auth list
Switch to context
$ doctl auth switch --context [context_name]
Remove auth context
$ doctl auth remove --context [context_name]

SYNOPSIS

doctl auth command [options]

DESCRIPTION

doctl auth manages authentication contexts for the DigitalOcean CLI. Contexts allow storing multiple API tokens for different accounts, teams, or environments.The init command prompts for or accepts an API token, storing it securely. Multiple contexts can be configured and switched between, enabling management of different DigitalOcean accounts from a single CLI installation.Authentication tokens are obtained from the DigitalOcean control panel and provide API access according to their scope.

PARAMETERS

COMMAND

Operation: init, list, switch, remove.
init
Initialize authentication with token.
list
List authentication contexts.
switch --context NAME
Switch active context.
remove --context NAME
Remove context.
--access-token TOKEN
API access token.
--context NAME
Context name.
--help
Display help information.

INSTALL

sudo dnf install doctl
sudo pacman -S doctl
sudo apk add doctl
brew install doctl
nix profile install nixpkgs#doctl

CAVEATS

Tokens are stored locally. Token scopes determine available actions. Expired or revoked tokens require re-authentication. Contexts are machine-specific.

HISTORY

doctl auth is part of the doctl CLI developed by DigitalOcean. Multi-context support enables users and organizations to manage multiple accounts efficiently.

SEE ALSO

doctl(1), doctl-compute-droplet(1)

RESOURCES

Source code · Documentation