LinuxCommandLibrary

doctl-auth

TLDR

Initialize authentication

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

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.

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

Copied to clipboard