Context Management
Context management allows you to set your working project and app once, then run commands without repeatedly specifying them.
Understanding Context
Section titled “Understanding Context”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.
Setting Context
Section titled “Setting Context”Use the interactive context selector:
brdz ctx:useThis command will:
- Show a list of your projects
- Prompt you to select a project
- Show apps in that project (if any)
- Prompt you to select an app
- Save your selection to
~/.brdz/context
Viewing Current Context
Section titled “Viewing Current Context”Check your current context:
brdz ctx:getOutput example:
Project: my-projectApp: my-appContext Storage
Section titled “Context Storage”Your context is stored in ~/.brdz/context:
~/.brdz/├── credentials # API key and hostname└── context # Current project/app contextOverriding Context
Section titled “Overriding Context”You can override the saved context using environment variables:
# Override projectexport BRDZ_PROJECT="different-project"
# Override appexport BRDZ_APP="different-app"
# Run commands with overridden contextbrdz apps:listContext-Aware Commands
Section titled “Context-Aware Commands”These commands use your current context:
Requires Project Context
Section titled “Requires Project Context”apps:create- Creates app in current projectapps:list- Lists apps in current projectapps:get- Gets app from current project
Requires App Context
Section titled “Requires App Context”releases:create- Creates release for current appreleases:list- Lists releases for current appreleases:rollback- Rollbacks current apphostnames:create- Adds hostname to current apphostnames:list- Lists hostnames for current app
Workflow Examples
Section titled “Workflow Examples”Initial Setup
Section titled “Initial Setup”# Create and select a projectbrdz projects:create my-projectbrdz ctx:use
# Create and select an appbrdz apps:create my-appbrdz ctx:use
# Now deploy without specifying project/appbrdz releases:create ./dist.zipSwitching Between Projects
Section titled “Switching Between Projects”# Switch to a different project and appbrdz ctx:use
# All subsequent commands use the new contextbrdz apps:listbrdz releases:listWorking with Multiple Apps
Section titled “Working with Multiple Apps”# Set context to first appbrdz ctx:use
# Deploy to first appbrdz releases:create ./app1.zip
# Switch to second appbrdz ctx:use
# Deploy to second appbrdz releases:create ./app2.zipContext in CI/CD
Section titled “Context in CI/CD”For automated deployments, use environment variables instead of interactive context:
# Set context via environmentexport BRDZ_PROJECT="production"export BRDZ_APP="web-app"
# Deploy without interactive promptsbrdz releases:create ./dist.zipBest Practices
Section titled “Best Practices”- Set context early - Run
ctx:useafter creating projects and apps - Verify context - Use
ctx:getbefore critical operations - Use environment variables in automation - Don’t rely on file-based context in CI/CD
- Update context when switching work - Change context when working on different projects
Troubleshooting
Section titled “Troubleshooting””No project in context” Error
Section titled “”No project in context” Error”If you see this error:
- Run
brdz ctx:useto set your project - Verify your project exists:
brdz projects:list - Check environment variables aren’t empty
”No app in context” Error
Section titled “”No app in context” Error”If you see this error:
- Run
brdz ctx:useto set your app - Verify your app exists:
brdz apps:list - Check you’re in the correct project context