Buildkite CLI auth command
The bk auth command allows you to manage authorization from the command line.
Commands
| Command | Description |
|---|---|
bk auth login |
Login to Buildkite using OAuth or an API token |
bk auth logout |
Logout and remove stored credentials |
bk auth status |
Print the current user auth status |
bk auth switch |
Switch to a different organization |
Login auth
Login to Buildkite using OAuth or an API token
bk auth login [flags]
Flags
| Flag | Description |
|---|---|
--debug |
Enable debug output for REST API calls |
--org=STRING |
Organization slug (required with --token) |
--scopes="" |
OAuth scopes to request |
--token=STRING |
API token to store (non-OAuth login) |
Examples
Login (select organization in browser):
bk auth login
Login non-interactively with an API token:
bk auth login --org my-org --token my-token
Login with custom scopes (e.g., for cluster management):
bk auth login --scopes "read_user read_organizations read_clusters write_clusters"
Logout auth
Logout and remove stored credentials
bk auth logout [flags]
Flags
| Flag | Description |
|---|---|
--all |
Log out of all organizations |
--debug |
Enable debug output for REST API calls |
--org=STRING |
Organization slug (defaults to currently selected organization) |
Status auth
Print the current user auth status
bk auth status [flags]
Flags
| Flag | Description |
|---|---|
-o, --output=""
|
Output format. One of: json, yaml, text |
--debug |
Enable debug output for REST API calls |
--json |
Output as JSON |
--text |
Output as text |
--yaml |
Output as YAML |
Examples
List the current token session:
bk auth status
Switch auth
Switch to a different organization
bk auth switch [<organization-slug>]
Arguments
| Argument | Description |
|---|---|
[<organization-slug>] |
Organization slug to switch |
Flags
| Flag | Description |
|---|---|
--debug |
Enable debug output for REST API calls |
Examples
Switch the 'my-cool-org' configuration:
bk auth switch my-cool-org
Interactively select an organization:
bk auth switch