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:

  1. Open the credentials.yaml file located at:

$HOME/.bricks/credentials.yaml
  1. Update the file with the following values:

    • Set token to the long-lived token.

    • Set userid to the value api_key.

Your updated credentials.yaml should look like this:

token: Bearer bbx_2b52642255....4ffd
userid: api_key

You’re now ready to use bricks CLI with your long-lived token for automation and scripting!

Last updated

Was this helpful?