Guides
Configuration
Global YAML config schema, channel definitions, environment interpolation, and validation rules.
brb uses one global YAML configuration file. It is loaded before any wrapped command or channel management command runs.
Print the resolved path:
brb config pathValidate the file after editing:
brb channels validateMinimal Config
version: 1
default_channels:
- desktop
channels:
desktop:
type: desktopValidation Rules
versionmust be1channelsmust contain at least one channeldefault_channelsmust contain at least one channel ID- every ID in
default_channelsmust exist underchannels - unknown YAML fields are rejected
Top-Level Fields
| Field | Type | Required | Notes |
|---|---|---|---|
version | integer | Yes | Must be 1. |
default_channels | string[] | Yes | Used when --channel is omitted. |
channels | map | Yes | Channel definitions keyed by your own channel IDs. |
Channel Types
| Type | Purpose | Required | Optional |
|---|---|---|---|
desktop | Local desktop notification | type | none |
webhook | HTTP JSON delivery | type, url | method, headers |
custom | Execute your own notifier process | type, exec | args, env |
Environment Interpolation
webhook and custom string values support environment interpolation with ${env:VAR_NAME}.
Example:
url: https://example.com/hook?token=${env:BRB_TOKEN}Interpolation rules:
- Missing environment variables cause config loading to fail.
- Invalid expressions such as
${env:}cause config loading to fail. - Interpolation applies to
webhook.url,webhook.method, webhook header values,custom.exec, custom arguments, and custom environment values. - Interpolation does not change channel IDs or
default_channels.
Webhook Channels
For type: webhook:
methoddefaults toPOSTwhen omitted.headersare optional.brbsends the completion event as a JSON request body.- Non-2xx responses are treated as delivery failures.
- Invalid HTTP methods or invalid header names and values fail fast.
Example:
channels:
ci-webhook:
type: webhook
url: ${env:BRB_WEBHOOK_URL}
method: POST
headers:
Authorization: Bearer ${env:BRB_WEBHOOK_TOKEN}
Content-Type: application/jsonExample with ntfy:
channels:
ntfy:
type: webhook
url: https://ntfy.sh/your-topic
method: POST
headers:
Title: brb: completed
Tags: crab
Priority: defaultCustom Channels
For type: custom:
execcan be an executable name, a relative path, or an absolute path.argsare passed as command-line arguments.envadds or overrides environment variables for the child process.brbwrites exactly one JSON completion event to the notifier's stdin.- Child stdout is discarded.
- Child stderr is captured for error reporting.
- Relative paths are resolved from the working directory where
brbis launched.
Example:
channels:
write:
type: custom
exec: ./scripts/notify.sh
args: []
env:
BRB_CUSTOM_LOG_FILE: /tmp/brb-custom-channel.logPath Resolution
Relative paths for custom.exec are resolved from the working directory where you run brb, not from the config file directory.
Full Example
This can be found in the repo under assets/examples/config.yml
version: 1
# channel ids used when you run `brb <command>` without `--channel`.
# every ID here must exist under `channels`.
default_channels:
- desktop
# all channels keyed by your own channel id
channels:
# minimal local notification channel.
# works without any extra fields.
desktop:
type: desktop
# generic webhook example
ci-webhook:
type: webhook # channel type: desktop | webhook | custom
# target URL for webhook delivery.
# `${env:VAR}` reads from environment variables at runtime.
url: ${env:BRB_WEBHOOK_URL}
method: POST # optional HTTP method (defaults to POST if omitted).
# optional request headers.
headers:
Authorization: Bearer ${env:BRB_WEBHOOK_TOKEN}
Content-Type: application/json
# custom executable channel example.
write:
type: custom
exec: abs/path/to/examples/write-to-logs.sh # executable to be ran on notify
args: [] # optional cli args passed to `exec`.
# optional environment overrides for the child process.
env:
BRB_CUSTOM_LOG_FILE: /tmp/brb-custom-channel.log
# real world examples
ntfy:
type: webhook
url: https://ntfy.sh/yourlinkgohere # remember ntfy webhooks are not password protected, make sure the url is hard enough to guess
method: POST
headers:
Title: 'brb: completed'
Tags: crab
Priority: defaultChoosing A Channel
- Use
desktopfor local awareness. - Use
webhookwhen another system already speaks HTTP. - Use
customwhen you need full control over formatting, retries, or transport. - Keep secrets in environment variables instead of hardcoding them into the YAML file.