Skip to content

Configuration

bnerd uses a YAML configuration file, environment variables, and command-line flags. These sources are merged with a clear precedence order.

Configuration Precedence

Values are resolved in this order (highest priority first):

  1. Command-line flags--token, --org-id, etc.
  2. Environment variablesBNERD_TOKEN, BNERD_ORG_ID, etc.
  3. Config file~/.bnerd.yaml
  4. Defaults — Built-in default values

Config File

Location

Default: ~/.bnerd.yaml

Override with the --config flag:

bnerd --config /path/to/config.yaml dns zones list

Initialize

bnerd config init

Creates a new config file at the default location with empty values.

Set Values

bnerd config set api-url https://api.bnerd.net
bnerd config set token YOUR_TOKEN
bnerd config set org-id YOUR_ORG_ID
bnerd config set project-id YOUR_PROJECT_ID

View Current Configuration

bnerd config show

File Format

# API connection
api-url: https://api.bnerd.net
token: your-bearer-token
org-id: your-organization-id
project-id: your-project-id          # optional

# AI features (optional)
anthropic-key: sk-ant-...
ai-model: haiku                       # haiku, sonnet, opus, or full model ID
ai-mode: read-only                    # read-only, non-destructive, full

# VPN configuration (optional)
vpn:
  server-endpoint: vpn.bnerd.net:51820
  server-public-key: SERVER_PUBLIC_KEY
  # See Reference > VPN Configuration for all options

See Configuration File Reference for the complete schema.

Environment Variables

All config keys can be set via environment variables with the BNERD_ prefix:

export BNERD_TOKEN=your-token
export BNERD_ORG_ID=your-org-id
export BNERD_API_URL=https://api.bnerd.net

Naming convention

Environment variable names are derived from config keys by uppercasing and replacing dashes with underscores: api-url becomes BNERD_API_URL, org-id becomes BNERD_ORG_ID.

Additionally, these standard environment variables are recognized:

  • ANTHROPIC_API_KEY — Alternative to BNERD_ANTHROPIC_KEY
  • OPENAI_API_KEY — Alternative to BNERD_OPENAI_KEY

See Environment Variables Reference for the complete list.

Global Flags

Flags available on every command:

--config string     Config file path (default "$HOME/.bnerd.yaml")
--api-url string    CloudAPI base URL
--token string      Bearer token for authentication
--org-id string     Organization ID
--project-id string Project ID
--region string     Cloud region (default "de-muc1")
--debug             Enable debug output
-o, --output string Output format: json|table|yaml (default "table")

See Global Flags Reference for the complete list including AI-related flags.

Resource Scoping

Some commands require a project context while others operate at the organization level:

Organization-scoped (require --org-id):

  • dns, domains, billing, organizations, members, invitations

Project-scoped (require --org-id and --project-id):

  • k8s, servers, volumes, networks, routers, loadbalancers, apps

Tip

Set org-id and project-id in your config file to avoid passing them on every command. You can switch projects in the TUI with the :projects command.