Skip to main content
BRICKS CLI uses authentication profiles to connect to your workspace. Each profile stores a token tied to a specific workspace.

Login

Get a one-time passcode from BRICKS Controller and use it to log in:
bricks auth login <passcode>
Generate the one-time passcode from Manage API Tokens in your workspace. The passcode expires after 5 minutes and can only be used once. You can also log in with a workspace token directly:
bricks auth login-token -t <token>
Generate or copy your workspace token from Manage API Tokens in BRICKS Controller.

Profiles

Profiles let you manage multiple workspace connections. Each login creates or updates a profile.
# Login and save to a named profile
bricks auth login <passcode> -p my-workspace

# List all profiles
bricks auth list

# Switch the active profile
bricks auth use <profile>

# Check which profile is active
bricks auth status

Per-command profile override

Use -ap or --auth-profile to run any command as a different profile without switching:
bricks -ap staging device list
bricks --auth-profile production app list
Resolution order: --auth-profile flag > BRICKS_PROFILE environment variable > stored active profile.

Logout

# Remove the current profile's token
bricks auth logout

# Remove a specific profile
bricks auth logout -p my-workspace

# Remove all profiles
bricks auth logout -a