← 返回命令列表

Linux command

doctl-auth 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Initialize authentication

doctl auth init

Initialize with token

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]

说明

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.

参数

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.

FAQ

What is the doctl-auth command used for?

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.

How do I run a basic doctl-auth example?

Run `doctl auth init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init do in doctl-auth?

Initialize authentication with token.