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 Port | --port | BROSKI_PORT | 18274 |
| Tailscale Funnel | --funnel | BROSKI_ENABLE_FUNNEL=1 | false |
| New Token | --new-token | - | false |
| Detect Hotspot | --hotspot | - | false |
| OpenCode URL | --opencode-url | OPENCODE_BASE_URL | - |
| OpenCode Hostname | --opencode-hostname | BROSKI_OPENCODE_HOSTNAME | 127.0.0.1 |
| OpenCode Port | --opencode-port | BROSKI_OPENCODE_PORT | 0 (random) |
CLI Options
Subcommands
broski (default)
Start the bridge server.
broski [options]broski install
Install as a background service that runs on login.
broski installCreates a LaunchAgent (macOS) or systemd service (Linux).
broski qr
Show the QR code to pair your phone (works with background service).
broski qr
broski qr --hotspot # Prioritize hotspot IPbroski 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 setup-tailscale
Interactive wizard to install and configure Tailscale for remote access.
broski setup-tailscalebroski 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 WebSocket port number.
- Default:
18274 - Env:
BROSKI_PORT - Special:
0= random free port
# Use custom port
broski --port 8080
# Use random available port
broski --port 0--funnel
Enable Tailscale Funnel for public HTTPS access.
- Requires: Tailscale connected, Funnel enabled in admin console
- Env:
BROSKI_ENABLE_FUNNEL=1
broski --funnelCreates a public HTTPS URL (e.g., https://machine.tailnet-name.ts.net). No VPN required on phone.
--new-token
Generate a new authentication token.
# Generate new token (invalidates old QR codes)
broski --new-tokenUse if you suspect your token has been compromised. New token is persisted to ~/.broski/token.json.
--hotspot
Detect and prioritize hotspot IP for mobile tethering.
broski --hotspot
broski qr --hotspotUseful when your phone is providing internet to your system via hotspot and you want to connect Broski over that same connection.
OpenCode Mode Options
Broski can connect to OpenCode in three modes:
--managed (default)
Let Broski start and manage an OpenCode server.
- Broski starts OpenCode on a random port
- Automatically restarts if OpenCode crashes
- OpenCode stops when Broski stops
--manual
Connect to an existing OpenCode server (requires URL).
# Manual mode with explicit URL
broski --manual --opencode-url http://localhost:4096
# Via environment variable
OPENCODE_BASE_URL=http://localhost:4096 broski--attach
Scan for running OpenCode servers and interactively choose one.
broski --attachScans common ports (4096, 64864-65119, 49152-49407). If multiple found, presents interactive selection menu.
Configuration Files
~/.broski/token.json
Persistent authentication state used for QR pairing and manual connection.
| Property | Value |
|---|---|
| Format | JSON (version, token, createdAt, expiresAt, lastUsedAt) |
| Permissions | 0600 (owner read/write only) |
| Token | Base64url random token |
| Created | Automatically on first run |
broski --new-token (or broski qr --new-token).~/.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 WebSocket port |
| BROSKI_ENABLE_FUNNEL | 1 or unset | unset | Enable Tailscale Funnel |
OpenCode Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| OPENCODE_BASE_URL | string | - | URL of existing OpenCode server |
| BROSKI_OPENCODE_HOSTNAME | string | 127.0.0.1 | Hostname for managed OpenCode |
| BROSKI_OPENCODE_PORT | number | 0 | Port for managed OpenCode (0 = random) |
AI Provider Variables
| Variable | Type | Description |
|---|---|---|
| ANTHROPIC_API_KEY | string | Anthropic API key for Claude Code |
| OPENAI_API_KEY | string | OpenAI API key for Codex/GPT models |
Configuration Examples
Minimal Setup
broskiUses all defaults: port 18274, managed OpenCode, no funnel.
Custom Port
broski --port 8080Tailscale with Funnel
broski --funnelPublic HTTPS access via Tailscale Funnel.
Manual OpenCode Connection
# Start OpenCode separately
opencode serve --port 4096
# Connect Broski to it
broski --opencode-url http://localhost:4096Claude Code Backend
# With API key
export ANTHROPIC_API_KEY=sk-ant-api03-...
broski
# Or with Claude login
claude login
broskiMobile Hotspot
# When your phone provides internet to your system
broski --hotspotProduction Setup with Environment
export BROSKI_PORT=18274
export BROSKI_ENABLE_FUNNEL=1
broskiCommon Configuration Mistakes
| Issue | Cause | Fix |
|---|---|---|
| Port in use | Another broski or process running | Kill process or use --port 0 |
| Connection refused | Wrong OpenCode URL | Check URL with curl <url>/path |
| Auth failed | Invalid or old token | Use --new-token to regenerate |
| Funnel failed | Not enabled in admin console | Enable at login.tailscale.com/admin |
| Claude Code unavailable | Missing API key | Set ANTHROPIC_API_KEY or run claude login |
| QR code not scanning | Old QR after restart | Rescan the current QR code |