Skip to content

Environment Variables

The brdz CLI can be configured using environment variables, which take precedence over file-based configuration.

Your API authentication key.

Usage:

Terminal window
export BRDZ_SECRET_ACCESS_KEY="your-api-key-here"

Precedence:

  • Overrides ~/.brdz/credentials
  • Required for API authentication
  • Essential for CI/CD pipelines

Example:

Terminal window
export BRDZ_SECRET_ACCESS_KEY="brdz_abc123xyz789"
brdz apps:list

The API server hostname.

Default: http://localhost:8001

Usage:

Terminal window
export BRDZ_HOSTNAME="https://api.brdz.io"

Precedence:

  • Overrides ~/.brdz/credentials
  • Useful for custom or self-hosted installations

Example:

Terminal window
export BRDZ_HOSTNAME="https://api.example.com"
brdz projects:list

The current project slug.

Usage:

Terminal window
export BRDZ_PROJECT="my-project"

Precedence:

  • Overrides ~/.brdz/context
  • Eliminates need for interactive context selection
  • Critical for automation

Example:

Terminal window
export BRDZ_PROJECT="production"
brdz apps:list # Lists apps in production project

The current app name.

Usage:

Terminal window
export BRDZ_APP="my-app"

Precedence:

  • Overrides ~/.brdz/context
  • Used for app-specific commands
  • Required for release and hostname operations in CI/CD

Example:

Terminal window
export BRDZ_APP="web-frontend"
brdz releases:create ./dist.zip

Configuration is loaded in this order (later overrides earlier):

  1. Default values (e.g., http://localhost:8001)
  2. Configuration files (~/.brdz/credentials, ~/.brdz/context)
  3. Environment variables (BRDZ_*)
Terminal window
# Use default localhost API
brdz auth:login
brdz projects:create my-project
Terminal window
# Point to production API
export BRDZ_HOSTNAME="https://api.brdz.io"
export BRDZ_SECRET_ACCESS_KEY="your-production-key"
brdz projects:list
#!/bin/bash
# Deployment script
# Set credentials from CI secrets
export BRDZ_SECRET_ACCESS_KEY="${CI_SECRET_KEY}"
export BRDZ_HOSTNAME="https://api.brdz.io"
# Set context
export BRDZ_PROJECT="production"
export BRDZ_APP="web-app"
# Build and deploy
npm run build
zip -r release.zip dist/
brdz releases:create release.zip
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install brdz
run: |
brew tap boardsofmusic/brdz
brew install brdz
- name: Build
run: npm run build
- name: Deploy
env:
BRDZ_SECRET_ACCESS_KEY: ${{ secrets.BRDZ_API_KEY }}
BRDZ_HOSTNAME: https://api.brdz.io
BRDZ_PROJECT: production
BRDZ_APP: web-app
run: |
zip -r release.zip dist/
brdz releases:create release.zip
Terminal window
# Deploy to staging
export BRDZ_PROJECT="staging"
export BRDZ_APP="web-app"
brdz releases:create staging-build.zip
# Deploy to production
export BRDZ_PROJECT="production"
export BRDZ_APP="web-app"
brdz releases:create production-build.zip
deploy.sh
#!/bin/bash
set -e
# Configuration
export BRDZ_SECRET_ACCESS_KEY="${BRDZ_API_KEY}"
export BRDZ_HOSTNAME="https://api.brdz.io"
export BRDZ_PROJECT="${1:-production}"
export BRDZ_APP="${2:-web-app}"
# Build
echo "Building application..."
npm run build
# Package
echo "Creating release archive..."
cd dist
zip -r ../release.zip .
cd ..
# Deploy
echo "Deploying to ${BRDZ_PROJECT}/${BRDZ_APP}..."
brdz releases:create release.zip
echo "Deployment complete!"

Usage:

Terminal window
chmod +x deploy.sh
BRDZ_API_KEY="your-key" ./deploy.sh production web-app

Never commit API keys to version control:

.gitignore
.env
.env.local

Store secrets in your CI/CD platform:

  • GitHub Actions: Repository secrets
  • GitLab CI: CI/CD variables
  • CircleCI: Environment variables
  • Jenkins: Credentials plugin
Terminal window
# Generate new key
brdz auth:login
# Update environment variables
export BRDZ_SECRET_ACCESS_KEY="new-key"
# Revoke old key (if supported)

Use project-specific keys when possible:

  • Create separate keys for different projects
  • Use read-only keys for monitoring
  • Rotate keys after team changes
Terminal window
# Store in secure environment file
echo "export BRDZ_SECRET_ACCESS_KEY='your-key'" >> ~/.brdz_env
chmod 600 ~/.brdz_env
# Source when needed
source ~/.brdz_env

If you see authentication errors:

  1. Check BRDZ_SECRET_ACCESS_KEY is set correctly
  2. Verify the key hasn’t expired
  3. Ensure no extra whitespace in the key
  4. Try re-authenticating: brdz auth:login

If commands use unexpected project/app:

  1. Check environment variables: env | grep BRDZ
  2. Verify context: brdz ctx:get
  3. Unset unwanted variables: unset BRDZ_PROJECT

If variables aren’t being recognized:

  1. Verify export syntax: export VAR=value
  2. Check for typos in variable names
  3. Ensure no quotes issues: Use "value" for values with spaces
  4. Verify the variable is in current shell: echo $BRDZ_SECRET_ACCESS_KEY
VariablePurposeDefaultOverride
BRDZ_SECRET_ACCESS_KEYAPI authenticationNone~/.brdz/credentials
BRDZ_HOSTNAMEAPI server URLhttp://localhost:8001~/.brdz/credentials
BRDZ_PROJECTCurrent projectNone~/.brdz/context
BRDZ_APPCurrent appNone~/.brdz/context