snippetbashTip
doctl auth — Authenticate `doctl` with API tokens. More information: <https://docs.digitalocean.com/reference/doc
Viewed 0 times
commandtokenscliwithauthenticatedoctl authdoctlapi
Problem
How to use the
doctl auth command: Authenticate doctl with API tokens. More information: <https://docs.digitalocean.com/reference/doctl/reference/auth/>.Solution
doctl auth — Authenticate doctl with API tokens. More information: <https://docs.digitalocean.com/reference/doctl/reference/auth/>.Open a prompt to enter an API token and label its context:
doctl auth init --context {{token_label}}List authentication contexts (API tokens):
doctl auth {{[ls|list]}}Switch contexts (API tokens):
doctl auth switch --context {{token_label}}Remove a stored authentication context (API token):
doctl auth remove --context {{token_label}}Show available commands:
doctl auth {{[-h|--help]}}Code Snippets
Open a prompt to enter an API token and label its context
doctl auth init --context {{token_label}}List authentication contexts (API tokens)
doctl auth {{[ls|list]}}Switch contexts (API tokens)
doctl auth switch --context {{token_label}}Remove a stored authentication context (API token)
doctl auth remove --context {{token_label}}Show available commands
doctl auth {{[-h|--help]}}Context
tldr-pages: common/doctl auth
Revisions (0)
No revisions yet.