digitalocean / digitalocean/doctl
Support configuring new auth context without interactivity
- Dominant language
- Go
- Stars
- 3.4k
- Forks
- 496
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
In some cases, it can be useful to configure `doctl` non-interactively. Currently, we support this when setting up the default context. For example, running the following will validate the token and add it to the `doctl` config file without additional user interaction:
```
doctl auth init -t $DO_TOKEN
Using token [asupersekrettokenthatisverylongidontwanttotypeit]
Validating token... OK
```
If the `--context` flag is added to that command, the token is ignored and the user is prompted to enter the token manually:
```
doctl auth init --context new-context -t $DO_TOKEN
DigitalOcean access token:
```
The behaviour should be consistent. When passing a token and a context together to `doctl auth init`, we should validate the token and configure a new context to use it without additional user input.
Contributor guide
Assessment
This issue has not been assessed yet.