Environment Variables
The brdz CLI can be configured using environment variables, which take precedence over file-based configuration.
Available Variables
Section titled “Available Variables”BRDZ_SECRET_ACCESS_KEY
Section titled “BRDZ_SECRET_ACCESS_KEY”Your API authentication key.
Usage:
export BRDZ_SECRET_ACCESS_KEY="your-api-key-here"Precedence:
- Overrides
~/.brdz/credentials - Required for API authentication
- Essential for CI/CD pipelines
Example:
export BRDZ_SECRET_ACCESS_KEY="brdz_abc123xyz789"brdz apps:listBRDZ_HOSTNAME
Section titled “BRDZ_HOSTNAME”The API server hostname.
Default: http://localhost:8001
Usage:
export BRDZ_HOSTNAME="https://api.brdz.io"Precedence:
- Overrides
~/.brdz/credentials - Useful for custom or self-hosted installations
Example:
export BRDZ_HOSTNAME="https://api.example.com"brdz projects:listBRDZ_PROJECT
Section titled “BRDZ_PROJECT”The current project slug.
Usage:
export BRDZ_PROJECT="my-project"Precedence:
- Overrides
~/.brdz/context - Eliminates need for interactive context selection
- Critical for automation
Example:
export BRDZ_PROJECT="production"brdz apps:list # Lists apps in production projectBRDZ_APP
Section titled “BRDZ_APP”The current app name.
Usage:
export BRDZ_APP="my-app"Precedence:
- Overrides
~/.brdz/context - Used for app-specific commands
- Required for release and hostname operations in CI/CD
Example:
export BRDZ_APP="web-frontend"brdz releases:create ./dist.zipConfiguration Precedence
Section titled “Configuration Precedence”Configuration is loaded in this order (later overrides earlier):
- Default values (e.g.,
http://localhost:8001) - Configuration files (
~/.brdz/credentials,~/.brdz/context) - Environment variables (
BRDZ_*)
Common Use Cases
Section titled “Common Use Cases”Local Development
Section titled “Local Development”# Use default localhost APIbrdz auth:loginbrdz projects:create my-projectProduction API
Section titled “Production API”# Point to production APIexport BRDZ_HOSTNAME="https://api.brdz.io"export BRDZ_SECRET_ACCESS_KEY="your-production-key"
brdz projects:listCI/CD Pipeline
Section titled “CI/CD Pipeline”#!/bin/bash# Deployment script
# Set credentials from CI secretsexport BRDZ_SECRET_ACCESS_KEY="${CI_SECRET_KEY}"export BRDZ_HOSTNAME="https://api.brdz.io"
# Set contextexport BRDZ_PROJECT="production"export BRDZ_APP="web-app"
# Build and deploynpm run buildzip -r release.zip dist/brdz releases:create release.zipGitHub Actions Example
Section titled “GitHub Actions Example”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.zipMultiple Environments
Section titled “Multiple Environments”# Deploy to stagingexport BRDZ_PROJECT="staging"export BRDZ_APP="web-app"brdz releases:create staging-build.zip
# Deploy to productionexport BRDZ_PROJECT="production"export BRDZ_APP="web-app"brdz releases:create production-build.zipShell Scripts
Section titled “Shell Scripts”#!/bin/bashset -e
# Configurationexport 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}"
# Buildecho "Building application..."npm run build
# Packageecho "Creating release archive..."cd distzip -r ../release.zip .cd ..
# Deployecho "Deploying to ${BRDZ_PROJECT}/${BRDZ_APP}..."brdz releases:create release.zip
echo "Deployment complete!"Usage:
chmod +x deploy.shBRDZ_API_KEY="your-key" ./deploy.sh production web-appSecurity Best Practices
Section titled “Security Best Practices”1. Never Commit Credentials
Section titled “1. Never Commit Credentials”Never commit API keys to version control:
.env.env.local2. Use Secret Management
Section titled “2. Use Secret Management”Store secrets in your CI/CD platform:
- GitHub Actions: Repository secrets
- GitLab CI: CI/CD variables
- CircleCI: Environment variables
- Jenkins: Credentials plugin
3. Rotate Keys Regularly
Section titled “3. Rotate Keys Regularly”# Generate new keybrdz auth:login
# Update environment variablesexport BRDZ_SECRET_ACCESS_KEY="new-key"
# Revoke old key (if supported)4. Limit Key Scope
Section titled “4. Limit Key Scope”Use project-specific keys when possible:
- Create separate keys for different projects
- Use read-only keys for monitoring
- Rotate keys after team changes
5. Secure Local Environment
Section titled “5. Secure Local Environment”# Store in secure environment fileecho "export BRDZ_SECRET_ACCESS_KEY='your-key'" >> ~/.brdz_envchmod 600 ~/.brdz_env
# Source when neededsource ~/.brdz_envTroubleshooting
Section titled “Troubleshooting””Unauthorized” Errors
Section titled “”Unauthorized” Errors”If you see authentication errors:
- Check
BRDZ_SECRET_ACCESS_KEYis set correctly - Verify the key hasn’t expired
- Ensure no extra whitespace in the key
- Try re-authenticating:
brdz auth:login
Wrong Project/App
Section titled “Wrong Project/App”If commands use unexpected project/app:
- Check environment variables:
env | grep BRDZ - Verify context:
brdz ctx:get - Unset unwanted variables:
unset BRDZ_PROJECT
Environment Not Loading
Section titled “Environment Not Loading”If variables aren’t being recognized:
- Verify export syntax:
export VAR=value - Check for typos in variable names
- Ensure no quotes issues: Use
"value"for values with spaces - Verify the variable is in current shell:
echo $BRDZ_SECRET_ACCESS_KEY
Reference Table
Section titled “Reference Table”| Variable | Purpose | Default | Override |
|---|---|---|---|
BRDZ_SECRET_ACCESS_KEY | API authentication | None | ~/.brdz/credentials |
BRDZ_HOSTNAME | API server URL | http://localhost:8001 | ~/.brdz/credentials |
BRDZ_PROJECT | Current project | None | ~/.brdz/context |
BRDZ_APP | Current app | None | ~/.brdz/context |