Skip to content

Configuration Files

The brdz CLI stores configuration in your home directory under ~/.brdz/.

~/.brdz/
├── credentials # API authentication
└── context # Current project/app
  • Linux/macOS: ~/.brdz/
  • Windows: %USERPROFILE%\.brdz\

Stores authentication information and API hostname.

Location: ~/.brdz/credentials

Created by: brdz auth:login

Format:

api_key=your-api-key-here
hostname=http://localhost:8001

Your API authentication key.

  • Generated during brdz auth:login
  • Required for all API operations
  • Can be overridden by BRDZ_SECRET_ACCESS_KEY

The API server URL.

  • Default: http://localhost:8001
  • Can point to custom or production servers
  • Can be overridden by BRDZ_HOSTNAME
api_key=brdz_abc123xyz789def456
hostname=https://api.brdz.io

Stores your current working project and app.

Location: ~/.brdz/context

Created by: brdz ctx:use

Format:

project=my-project
app=my-app

The currently selected project slug.

  • Set by brdz ctx:use
  • Used by project-aware commands
  • Can be overridden by BRDZ_PROJECT

The currently selected app name.

  • Set by brdz ctx:use
  • Used by app-aware commands
  • Can be overridden by BRDZ_APP
project=production
app=web-frontend

Configuration files should have restricted permissions:

Terminal window
# Recommended permissions
chmod 600 ~/.brdz/credentials
chmod 600 ~/.brdz/context

This ensures only your user can read the files.

Terminal window
# View credentials (be careful with output)
cat ~/.brdz/credentials
# View context
cat ~/.brdz/context
# Or use the CLI
brdz ctx:get
Terminal window
# Edit credentials
nano ~/.brdz/credentials
# Edit context
nano ~/.brdz/context
Terminal window
# Delete and re-authenticate
rm ~/.brdz/credentials
brdz auth:login
# Reset context
rm ~/.brdz/context
brdz ctx:use
Terminal window
# Backup your configuration
cp -r ~/.brdz ~/.brdz.backup
# Restore from backup
cp -r ~/.brdz.backup ~/.brdz

For managing multiple accounts or environments, you can use shell aliases:

Terminal window
# In ~/.bashrc or ~/.zshrc
# Production profile
alias brdz-prod='BRDZ_SECRET_ACCESS_KEY=prod-key BRDZ_HOSTNAME=https://api.brdz.io brdz'
# Staging profile
alias brdz-staging='BRDZ_SECRET_ACCESS_KEY=staging-key BRDZ_HOSTNAME=https://staging-api.brdz.io brdz'
# Local development
alias brdz-local='BRDZ_SECRET_ACCESS_KEY=local-key BRDZ_HOSTNAME=http://localhost:8001 brdz'

Usage:

Terminal window
brdz-prod projects:list
brdz-staging releases:create ./dist.zip
brdz-local apps:list

Configuration values are resolved in this order:

  1. Default values (hardcoded defaults)
  2. Configuration files (~/.brdz/credentials, ~/.brdz/context)
  3. Environment variables (BRDZ_* variables)

Environment variables always take precedence over files.

Terminal window
# Set restrictive permissions
chmod 600 ~/.brdz/credentials
chmod 600 ~/.brdz/context
# Verify permissions
ls -la ~/.brdz/

Add to .gitignore:

.brdz/
Terminal window
# Generate new key
brdz auth:login
# This updates ~/.brdz/credentials automatically

4. Use Environment Variables in Shared Environments

Section titled “4. Use Environment Variables in Shared Environments”

On shared systems, prefer environment variables over files:

Terminal window
export BRDZ_SECRET_ACCESS_KEY="your-key"
export BRDZ_HOSTNAME="https://api.brdz.io"
Terminal window
# Clear sensitive context
rm ~/.brdz/context
# Or set to non-sensitive defaults
brdz ctx:use # Select test project

If you see this error:

  1. Check file exists: ls ~/.brdz/credentials
  2. Verify permissions: ls -la ~/.brdz/
  3. Re-authenticate: brdz auth:login
  4. Check environment variables: env | grep BRDZ

If you see this error:

  1. Check file exists: ls ~/.brdz/context
  2. View contents: cat ~/.brdz/context
  3. Set context: brdz ctx:use
  4. Or use environment variable: export BRDZ_PROJECT=my-project

If you can’t read/write configuration:

  1. Check ownership: ls -la ~/.brdz/
  2. Fix ownership: sudo chown -R $USER ~/.brdz/
  3. Fix permissions: chmod -R 600 ~/.brdz/*

If configuration is corrupted:

Terminal window
# Backup current config
mv ~/.brdz ~/.brdz.corrupted
# Create fresh directory
mkdir -p ~/.brdz
# Re-authenticate
brdz auth:login
# Reset context
brdz ctx:use
Terminal window
# Create portable backup
tar -czf brdz-config-backup.tar.gz -C ~/ .brdz/
# Copy to another machine
scp brdz-config-backup.tar.gz user@remote:~/
Terminal window
# Extract on new machine
tar -xzf brdz-config-backup.tar.gz -C ~/
# Verify
brdz ctx:get

For teams sharing access (only share context, not credentials):

Terminal window
# Export context only
cat ~/.brdz/context > team-context.txt
# Import context
cat team-context.txt > ~/.brdz/context
# Each team member uses their own credentials
brdz auth:login