Skip to content

Context Management

Context management allows you to set your working project and app once, then run commands without repeatedly specifying them.

The brdz CLI maintains a context that includes:

  • Current project - The project you’re working with
  • Current app - The app within that project

Once set, commands that require a project or app will use your context automatically.

Use the interactive context selector:

Terminal window
brdz ctx:use

This command will:

  1. Show a list of your projects
  2. Prompt you to select a project
  3. Show apps in that project (if any)
  4. Prompt you to select an app
  5. Save your selection to ~/.brdz/context

Check your current context:

Terminal window
brdz ctx:get

Output example:

Project: my-project
App: my-app

Your context is stored in ~/.brdz/context:

~/.brdz/
├── credentials # API key and hostname
└── context # Current project/app context

You can override the saved context using environment variables:

Terminal window
# Override project
export BRDZ_PROJECT="different-project"
# Override app
export BRDZ_APP="different-app"
# Run commands with overridden context
brdz apps:list

These commands use your current context:

  • apps:create - Creates app in current project
  • apps:list - Lists apps in current project
  • apps:get - Gets app from current project
  • releases:create - Creates release for current app
  • releases:list - Lists releases for current app
  • releases:rollback - Rollbacks current app
  • hostnames:create - Adds hostname to current app
  • hostnames:list - Lists hostnames for current app
Terminal window
# Create and select a project
brdz projects:create my-project
brdz ctx:use
# Create and select an app
brdz apps:create my-app
brdz ctx:use
# Now deploy without specifying project/app
brdz releases:create ./dist.zip
Terminal window
# Switch to a different project and app
brdz ctx:use
# All subsequent commands use the new context
brdz apps:list
brdz releases:list
Terminal window
# Set context to first app
brdz ctx:use
# Deploy to first app
brdz releases:create ./app1.zip
# Switch to second app
brdz ctx:use
# Deploy to second app
brdz releases:create ./app2.zip

For automated deployments, use environment variables instead of interactive context:

Terminal window
# Set context via environment
export BRDZ_PROJECT="production"
export BRDZ_APP="web-app"
# Deploy without interactive prompts
brdz releases:create ./dist.zip
  1. Set context early - Run ctx:use after creating projects and apps
  2. Verify context - Use ctx:get before critical operations
  3. Use environment variables in automation - Don’t rely on file-based context in CI/CD
  4. Update context when switching work - Change context when working on different projects

If you see this error:

  1. Run brdz ctx:use to set your project
  2. Verify your project exists: brdz projects:list
  3. Check environment variables aren’t empty

If you see this error:

  1. Run brdz ctx:use to set your app
  2. Verify your app exists: brdz apps:list
  3. Check you’re in the correct project context