Skip to content

Configuration

The CLI stores its configuration in ~/.agent-to-bricks/config.yaml. The bricks config commands read and write this file, but you can also edit it directly.

Here’s a complete config file with every available option:

site:
url: https://your-site.com
api_key: atb_a3b7c9d2e8f4...
KeyDescriptionExample
site.urlYour WordPress site URL, including the protocolhttps://your-site.com
site.api_keyAPI key from Settings > Agent to Bricks in WordPressatb_a3b7c9d2e8f4...

Use bricks config set to update individual keys:

Terminal window
bricks config set site.url https://your-site.com
bricks config set site.api_key atb_a3b7c9d2e8f4

Or run the interactive wizard to set everything at once:

Terminal window
bricks config init

You can override any config value with an environment variable. This is useful for CI pipelines, Docker containers, or keeping API keys out of the config file.

The pattern is ATB_ followed by the config key in uppercase with underscores replacing dots:

Config keyEnvironment variable
site.urlATB_SITE_URL
site.api_keyATB_SITE_API_KEY

Environment variables take precedence over the config file. Example:

Terminal window
ATB_SITE_URL=https://staging.your-site.com \
ATB_SITE_API_KEY=atb_staging_key_here_here \
bricks site info

This connects to your staging site without modifying config.yaml.

The config file supports a single site by default. To work with multiple sites, use environment variables to switch between them:

Terminal window
# Production
ATB_SITE_URL=https://your-site.com \
ATB_SITE_API_KEY=atb_prod_key_here \
bricks site info
# Staging
ATB_SITE_URL=https://staging.your-site.com \
ATB_SITE_API_KEY=atb_staging_key_here \
bricks site info

For convenience, wrap these in shell aliases or a small script:

Mac / Linux — add to your .bashrc or .zshrc:

Terminal window
alias bricks-prod='ATB_SITE_URL=https://your-site.com ATB_SITE_API_KEY=atb_prod_key_here bricks'
alias bricks-staging='ATB_SITE_URL=https://staging.your-site.com ATB_SITE_API_KEY=atb_staging_key_here bricks'

Windows — add to your PowerShell profile ($PROFILE):

Terminal window
function bricks-prod { $env:ATB_SITE_URL='https://your-site.com'; $env:ATB_SITE_API_KEY='atb_prod_key_here'; bricks @args }
function bricks-staging { $env:ATB_SITE_URL='https://staging.your-site.com'; $env:ATB_SITE_API_KEY='atb_staging_key_here'; bricks @args }

Then use them like any other command:

Terminal window
bricks-staging site info
bricks-prod site pull 1460

The config file lives at ~/.agent-to-bricks/config.yaml on all platforms:

PlatformPath
Mac / Linux~/.agent-to-bricks/config.yaml
WindowsC:\Users\YourName\.agent-to-bricks\config.yaml

The CLI creates this directory and file automatically the first time you run bricks config init or bricks config set.

To see what’s currently configured:

Terminal window
bricks config list

This prints the active configuration with API keys partially redacted.