Authenticate with Bricks CLI

Bricks CLI supports multiple authentication methods. This article covers the essentials for getting authenticated quickly.

For full CLI installation, configuration, and troubleshooting details, see the Bricks CLI overviewarrow-up-right.

Interactive Login

bricks login

This opens your browser for OAuth authentication. After login, your token is saved to ~/.bricks/environment.yaml.

Verify your authentication:

bricks whoami

API Key Authentication

For automation and CI/CD, use API keys instead of interactive login. See How to Create API Keys for setup instructions.

# Environment variable (recommended for CI/CD)
export BRICKS_API_KEY="your-api-key-here"

# Command line flag
bricks collection create --name "my_collection" --api-key "your-api-key-here"

Authentication Priority

Bricks CLI checks authentication in this order:

  1. Command line flag (--api-key)

  2. Environment variable (BRICKS_API_KEY)

  3. Configuration file (~/.bricks/config.yaml)

  4. JWT token (from bricks login)

Logout

See also

Last updated

Was this helpful?