Skip to main content

Configuration sources

BrowserWire merges configuration from four sources. When the same option is set in multiple places, the source with the highest precedence wins:
PrecedenceSource
1 (highest)CLI flags
2Environment variables / .env file
3Config file (~/.browserwire/config.json)
4 (lowest)Built-in defaults

Environment variables

Place these in your shell environment or in a .env file in your working directory.
VariableDescriptionDefault
BROWSERWIRE_LLM_PROVIDERLLM provider to use (openai, anthropic, gemini, ollama)
BROWSERWIRE_LLM_API_KEYAPI key for the chosen provider
BROWSERWIRE_LLM_MODELOverride the provider’s default modelProvider default
BROWSERWIRE_LLM_BASE_URLCustom API endpoint (useful for Ollama or proxies)Provider default
BROWSERWIRE_HOSTAddress the server listens on127.0.0.1
BROWSERWIRE_PORTPort the server listens on8787
BROWSERWIRE_LLM_API_KEY is required for all providers except ollama.

Config file

You can store persistent settings in ~/.browserwire/config.json. BrowserWire creates the directory automatically if it does not exist.
{
  "llmProvider": "openai",
  "llmApiKey": "sk-...",
  "llmModel": "gpt-4o",
  "llmBaseUrl": "https://api.openai.com/v1",
  "host": "127.0.0.1",
  "port": 8787
}
Only include keys you want to set — omitted keys fall back to environment variables or defaults.

.env file

BrowserWire automatically loads a .env file from the directory where you run the browserwire command. This is convenient for per-project configuration without touching your shell profile.
# .env
BROWSERWIRE_LLM_PROVIDER=anthropic
BROWSERWIRE_LLM_API_KEY=sk-ant-...
BROWSERWIRE_PORT=9000
.env values do not override variables that are already set in your shell environment.

CLI flags

CLI flags take precedence over all other sources.
FlagDescription
--host <address>Address the server listens on
--port <number>Port the server listens on
--debugEnable verbose debug logging
--llm-provider <name>LLM provider
--llm-api-key <key>API key for the provider
--helpPrint usage information
# Start on a custom host and port
browserwire --host 0.0.0.0 --port 3000

# Pass LLM credentials directly
browserwire --llm-provider anthropic --llm-api-key sk-ant-...

# Enable debug logging
browserwire --debug
Passing secrets like --llm-api-key as CLI flags may expose them in shell history. Prefer environment variables or the config file for sensitive values.