Configuration
Bub resolves configuration in this order (highest priority first):
- Environment variables (
BUB_prefix); .envin the current workspace;~/.bub/config.yml(created bybub onboard).
Unset fields use their defaults. See the Settings reference for all options.
1. Run the setup wizard
Section titled “1. Run the setup wizard”Run the following command in your terminal to start the interactive setup wizard and generate ~/.bub/config.yml:
bub onboard2. Inspect the config file
Section titled “2. Inspect the config file”Now inspect ~/.bub/config.yml. Here is an example of what it looks like:
model: openrouter:openrouter/freeapi_key: sk-or-...telegram: token: "123456789:your-telegram-bot-token" allow_users: "123456789,your_username"3. Use environment variables
Section titled “3. Use environment variables”Common environment variables:
| Variable | Description |
|---|---|
BUB_MODEL |
Model identifier in provider:model format (e.g. openrouter:openrouter/free, codex:<model>) |
BUB_API_KEY |
API key for the current provider (not needed with bub login) |
BUB_API_BASE |
Provider API base URL; leave blank for the default endpoint |
BUB_HOME |
Runtime data directory (default ~/.bub) |
BUB_<PROVIDER>_API_KEY |
Provider-specific API key, e.g. BUB_OPENROUTER_API_KEY |
BUB_<PROVIDER>_API_BASE |
Provider-specific API base URL |
See the Settings reference for the full table.
4. Configure fallback models
Section titled “4. Configure fallback models”Set fallback_models to try backup models in order when the primary model is unavailable:
model: openai:gpt-5-minifallback_models: - openrouter:openrouter/freeEach candidate provider requires valid credentials. Fallbacks apply only when creating a client or opening the request stream fails; errors after streaming has started do not retry on another model to avoid duplicate tool side effects. See Models and fallback.
5. Configure Telegram (optional)
Section titled “5. Configure Telegram (optional)”If you want to use Bub as a Telegram bot, configure the built-in Telegram channel in .env:
BUB_TELEGRAM_TOKEN=123456789:your-telegram-bot-tokenBUB_TELEGRAM_ALLOW_USERS=123456789,your_usernameBUB_TELEGRAM_ALLOW_CHATS=-1001234567890BUB_TELEGRAM_PROXY=http://127.0.0.1:7890 # optionalSee Telegram gateway for details.
6. Verify
Section titled “6. Verify”Now try talking to Bub with a one-off prompt to verify your setup:
$ bub run "Can you introduce yourself?"
[cli:local]I'm a virtual assistant designed to support a wide range of tasks...