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):

  1. CLI arguments - Always take precedence
  2. Environment variables - Override config files
  3. Configuration files - Override defaults
  4. Default values - Built-in fallbacks
bash
# CLI overrides env var
BROSKI_PORT=8080 broski --port 9090
# Result: Port 9090 is used

Quick Reference

SettingCLI FlagEnv VariableDefault
Bridge Loopback Port--portBROSKI_PORT18274
Loopback TLS--tls / --no-tlsBROSKI_TLSenabled
New Local Hook Token--new-token-false

CLI Options

Subcommands

broski (default)

Start the bridge server.

bash
broski [options]

broski install

Install Broski Link as a background service that runs on login and supervises the bridge.

bash
broski install

Registers 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).

bash
broski-link pair

The code is single-use and expires after 10 minutes.

broski doctor

Run diagnostics, apply safe fixes, and export support bundles.

bash
broski doctor
broski doctor --fix
broski doctor --profile pairing
broski doctor --export

Profiles: all, network, pairing, agents, daemon, security.

broski-link

The Broski Link daemon: pairing, devices and link status.

bash
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.

bash
broski status     # Check if running
broski stop       # Stop the service
broski uninstall  # Remove the service

Connection 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
bash
# Use custom port
broski --port 8080

# Use random available port
broski --port 0

--new-token

Generate a new local hook token.

bash
broski --new-token

Invalidates 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).

KeyTypeDescription
relaystringRelay URL, e.g. wss://relay.example.com. Enables the relay route and puts the relay in pairing QR codes
lan_portnumberPort for direct local-network connections (default 18275)
lanbooleanSet 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.

PropertyValue
FormatJSON (version, token, createdAt, lastUsedAt)
Permissions0600 (owner read/write only)
TokenBase64url random token
CreatedAutomatically on first run
Security
This file contains the local hook token. Never share it or commit it to version control. To invalidate it: run broski --new-token. It is not used for pairing phones.

~/.broski/custom-tools.json

Custom tool definitions for Claude Code.

json
{
  "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

VariableTypeDefaultDescription
BROSKI_PORTnumber18274Bridge loopback port
BROSKI_TLS0 or 11TLS on the loopback listener used by agent hooks

AI Provider Variables

VariableTypeDescription
ANTHROPIC_API_KEYstringAnthropic API key for Claude Code
OPENAI_API_KEYstringOpenAI API key for Pi's OpenAI models

Configuration Examples

Minimal Setup

bash
broski

Uses all defaults: loopback port 18274.

Custom Port

bash
broski --port 8080

Pair a Phone

bash
broski install
broski-link pair

Starts Broski Link and shows a QR code for the Broski app.

Claude Code Backend

bash
# With API key
export ANTHROPIC_API_KEY=sk-ant-api03-...
broski

# Or with Claude login
claude login
broski

Relay for Remote Access

json
// ~/.broski/link/config.json
{
  "relay": "wss://relay.example.com"
}

Restart with broski restart, then run broski-link pair.

Custom Loopback Port

bash
export BROSKI_PORT=18274
broski

Common Configuration Mistakes

IssueCauseFix
Port in useAnother broski or process runningKill process or use --port 0
Agent hooks get 401Stale local hook tokenRestart the bridge, or run broski --new-token
Claude Code unavailableMissing API keySet ANTHROPIC_API_KEY or run claude login
QR code not scanningQR expired or already usedRun broski-link pair for a new one

Next Steps