Configuration
Complete reference for all CLI options, environment variables, and configuration files.
Configuration Precedence
When the same setting is available in multiple places, the following order applies (highest to lowest):
- CLI arguments - Always take precedence
- Environment variables - Override config files
- Configuration files - Override defaults
- Default values - Built-in fallbacks
# CLI overrides env var
BROSKI_PORT=8080 broski --port 9090
# Result: Port 9090 is usedQuick Reference
| Setting | CLI Flag | Env Variable | Default |
|---|---|---|---|
| Bridge Loopback Port | --port | BROSKI_PORT | 18274 |
| Loopback TLS | --tls / --no-tls | BROSKI_TLS | enabled |
| New Local Hook Token | --new-token | - | false |
CLI Options
Subcommands
broski (default)
Start the bridge server.
broski [options]broski install
Install Broski Link as a background service that runs on login and supervises the bridge.
broski installRegisters broski-link as a LaunchAgent (macOS) or systemd user service (Linux). Windows is not supported.
broski-link pair
Show the QR code to pair your phone (works with the background service).
broski-link pairThe code is single-use and expires after 10 minutes.
broski doctor
Run diagnostics, apply safe fixes, and export support bundles.
broski doctor
broski doctor --fix
broski doctor --profile pairing
broski doctor --exportProfiles: all, network, pairing, agents, daemon, security.
broski-link
The Broski Link daemon: pairing, devices and link status.
broski-link pair # show a pairing QR
broski-link status # bridge, relay and session status
broski-link devices # list paired phones
broski-link revoke <id prefix>broski status / stop / uninstall
Manage the background service.
broski status # Check if running
broski stop # Stop the service
broski uninstall # Remove the serviceConnection Options
--port <number>
Bridge loopback listener port (agent hooks, dashboard, dev-server proxy). Phones do not connect to it.
- Default:
18274 - Env:
BROSKI_PORT - Special:
0= random free port
# Use custom port
broski --port 8080
# Use random available port
broski --port 0--new-token
Generate a new local hook token.
broski --new-tokenInvalidates the token the agent hooks use. It does not affect paired phones. The new token is persisted to ~/.broski/token.json.
Configuration Files
~/.broski/link/config.json
Optional settings for the Broski Link service (broski-link).
| Key | Type | Description |
|---|---|---|
| relay | string | Relay URL, e.g. wss://relay.example.com. Enables the relay route and puts the relay in pairing QR codes |
| lan_port | number | Port for direct local-network connections (default 18275) |
| lan | boolean | Set to false to turn off direct local-network connections |
Restart with broski restart after changing it.
~/.broski/token.json
Local bearer token for the bridge's loopback listener, used by the Claude Code permission hook.
| Property | Value |
|---|---|
| Format | JSON (version, token, createdAt, lastUsedAt) |
| Permissions | 0600 (owner read/write only) |
| Token | Base64url random token |
| Created | Automatically on first run |
broski --new-token. It is not used for pairing phones.~/.broski/custom-tools.json
Custom tool definitions for Claude Code.
{
"version": 1,
"tools": [
{
"id": "tool_1234567890_abc123",
"name": "my_custom_tool",
"description": "Description of what the tool does",
"parameters": [
{
"name": "input",
"type": "string",
"description": "Input parameter",
"required": true
}
],
"handler": "http",
"handlerConfig": {
"url": "https://api.example.com/endpoint",
"method": "POST"
},
"enabled": true
}
]
}~/.claude/settings.json
Claude CLI authentication (managed by claude login).
Broski checks this file if ANTHROPIC_API_KEY is not set.
Environment Variables
Bridge Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| BROSKI_PORT | number | 18274 | Bridge loopback port |
| BROSKI_TLS | 0 or 1 | 1 | TLS on the loopback listener used by agent hooks |
AI Provider Variables
| Variable | Type | Description |
|---|---|---|
| ANTHROPIC_API_KEY | string | Anthropic API key for Claude Code |
| OPENAI_API_KEY | string | OpenAI API key for Pi's OpenAI models |
Configuration Examples
Minimal Setup
broskiUses all defaults: loopback port 18274.
Custom Port
broski --port 8080Pair a Phone
broski install
broski-link pairStarts Broski Link and shows a QR code for the Broski app.
Claude Code Backend
# With API key
export ANTHROPIC_API_KEY=sk-ant-api03-...
broski
# Or with Claude login
claude login
broskiRelay for Remote Access
// ~/.broski/link/config.json
{
"relay": "wss://relay.example.com"
}Restart with broski restart, then run broski-link pair.
Custom Loopback Port
export BROSKI_PORT=18274
broskiCommon Configuration Mistakes
| Issue | Cause | Fix |
|---|---|---|
| Port in use | Another broski or process running | Kill process or use --port 0 |
| Agent hooks get 401 | Stale local hook token | Restart the bridge, or run broski --new-token |
| Claude Code unavailable | Missing API key | Set ANTHROPIC_API_KEY or run claude login |
| QR code not scanning | QR expired or already used | Run broski-link pair for a new one |