Authenticate Using Long-Lived Tokens
Developers can use long-lived tokens to authenticate the CLI and integrate bricks CLI commands into scripts and automation workflows, such as CI/CD pipelines or AI operations.
This guide explains how to configure a long-lived token as the authentication key for the CLI.
Generate a Long-Lived Token
Ensure you have a valid long-lived token. Read here to learn how to create tokens.
Once created, your token will look like this:
{
"api_key": "bbx_2b52642255....4ffd"
}Embed the Token in the Configuration File
The bricks CLI uses various configuration files. The credentials.yaml file stores your authentication key and identity.
To authenticate using the long-lived token:
Open the
credentials.yamlfile located at:
$HOME/.bricks/credentials.yamlUpdate the file with the following values:
Set
tokento the long-lived token.Set
useridto the valueapi_key.
Your updated credentials.yaml should look like this:
token: Bearer bbx_2b52642255....4ffd
userid: api_keyYou’re now ready to use bricks CLI with your long-lived token for automation and scripting!
Last updated
Was this helpful?

