Skip to content

Configuration Overview

Snippbot uses a four-tier configuration system. Values are resolved in this priority order (highest first):

1. Environment variables (SNIPPBOT_*, ANTHROPIC_API_KEY, etc.)
2. Encrypted SecretStore (~/.snippbot/secrets.db — for sensitive keys only)
3. Config file (~/.snippbot/config.toml)
4. Default values (built into the application)

The first tier with a non-empty value wins.

  • Sensitive keys (API keys, tokens listed in UserConfig.SENSITIVE_KEYS): all four tiers are consulted. The CLI writes new sensitive values to the encrypted SecretStore — never to plaintext config.toml. Legacy plaintext values are auto-migrated to the SecretStore on first server start.
  • Non-sensitive keys (ports, hosts, log level, booleans, paths): three tiers — env var → config file → default. The SecretStore tier is skipped.

This means you can safely commit an example config.toml without leaking secrets: sensitive values never end up in that file.


The config file lives at ~/.snippbot/config.toml:

~/.snippbot/config.toml
# Server settings
server_host = "" # Empty = dual-stack (IPv4 + IPv6)
server_port = 18781
log_level = "info"
auto_open_browser = true
# AI provider keys
anthropic_api_key = "sk-ant-..."
openai_api_key = ""
# Optional
data_dir = "~/.snippbot"

View and edit the config via CLI:

Terminal window
snippbot config list # Show all values
snippbot config set log_level debug
snippbot config get server_port
snippbot config path # Show file location

All config keys are available as environment variables. The naming convention is:

Config keyEnvironment variable
server_portSNIPPBOT_PORT
server_hostSNIPPBOT_HOST
log_levelSNIPPBOT_LOG_LEVEL
anthropic_api_keyANTHROPIC_API_KEY
openai_api_keyOPENAI_API_KEY

For the full list, see Environment Variables.


Snippbot separates system configuration from user profile data:

DataStoragePurpose
API keys, ports, log level~/.snippbot/config.tomlSystem / service configuration
Display name, email, avatar, timezoneprofile_settings.dbUser profile and preferences
Auth credentials, sessions, API keysauth.dbAuthentication
Setup wizard progress~/.snippbot/setup.jsonTransient setup state

User profile data is managed via the Settings page in the UI, not via config.toml.


ServiceDefaultEnvironment variable
Backend API18781SNIPPBOT_PORT
Channel adapter18790SNIPPBOT_CHANNEL_PORT
Gateway8787SNIPPBOT_GATEWAY_PORT
UI dev server5173SNIPPBOT_UI_PORT