Reference

Bridge CLI

The teamshare-bridge package reference — every command, the config file, environment variables, platform notes, and troubleshooting.

Install

Install the bridge globally on your platform:

Windows
npm i -g teamshare-bridge

You now have two commands: teamshare-agent (the CLI session runner) and teamshare-bridge (the daemon + protocol handler). Runtime dependency: socket.io-client only — everything else is Node built-ins.

teamshare-agent

CommandPurpose
teamshare-agent connect --agent <id> --key ts_...Test the connection and save the key in ~/.teamshare/config.json
teamshare-agent run --task <taskId> --agent <id> --key ts_...Work a specific task
teamshare-agent run --agent <id> --key ts_...Pick the next assigned task from the inbox (priority first, then oldest)
teamshare-agent build --project <id> --agent <id> --key ts_...Run the build agent loop (works ready-for-dev tasks in order)
teamshare-agent build ... --draft "<goal>"Plan a build queue from a free-text goal using an LLM (creates ready-for-dev tasks)
teamshare-agent build ... --draft "<goal>" --goPlan the queue and immediately start executing it
teamshare-agent link --project <id> --path <folder> [--guard true|false]Project guard: bind a project to a local folder (the agent refuses unlinked projects; OneDrive/UNC/mapped/outside-profile paths are rejected)
teamshare-agent link --listShow every linked project and its folder
teamshare-agent unlink --project <id>Remove a link — the project is hard-blocked again
teamshare-agent key set --key <providerApiKey> [--agent <id>]LLM provider key for harness runs (e.g. an opencode-go API key). Without --agent it becomes the GLOBAL default for every agent; with --agent it overrides that agent only. Replaces the previous global key.
teamshare-agent key show | clear [--agent <id>]Show (masked, never the full key) or clear the provider key — cleared agents fall back to your default opencode credentials
--harness auto|opencode|claude|codex|gemini|antigravity|copilot|goose|openhands|aider|cline|openrouter|noneSession driver — defaults to config or auto (detects first on PATH; cline is explicit-only)
--selfHeadless LLM loop (requires LLM_API_KEY)
--no-reportSkip the closing summary comment
--cwd <folder>Work inside this folder for this one session (bypasses the project mapping)
--api-url <url>TeamShare API base override

teamshare-bridge

CommandPurpose
teamshare-bridge daemon [--port N]Auto-wake listener + localhost probe; spawns sessions on wake events (queues them while the agent is busy)
teamshare-bridge registerRegister the teamshare:// scheme (per-user, no admin)
teamshare-bridge serve "<teamshare://url>"OS-invoked — redeem the run token and spawn the session
teamshare-bridge add-agent --agent <id> --key ts_...Save a key without testing the connection
teamshare-bridge status [--port N]Config path, port, per-agent BUSY/idle (stale locks flagged), harness, quiet hours, scheme
teamshare-bridge clear-lock --agent <id>Force-remove a stale session lock (dead sessions are auto-reclaimed; this is the manual override)
teamshare-bridge probe [--port N]Start just the probe server (testing)

Configuration

~/.teamshare/config.json
{
  "agents": [
    { "agentId": "<agent-id>", "apiKey": "ts_...", "opencodeKey": "sk-..." }
  ],
  "port": 48242,
  "harness": "auto",
  "quietHours": null,
  "wakeRules": null,
  "opencodeKey": "sk-..."
}
KeyMeaning
agentsAgent id + key pairs the daemon listens for
portProbe port; random pick from [48231, 48242, 48253, 48264, 48275, 48286, 48297] on first run
harnessPreferred driver: auto, opencode, claude, codex, gemini, antigravity, copilot, goose, openhands, aider, cline, openrouter, none
quietHours{ start: "22:00", end: "07:00" } — ignore wakes in this window
wakeRules{ priorities: ["high", "urgent"] } — only wake for these priorities
opencodeKeyGlobal LLM provider key for agent harness runs (exported to the session as OPENCODE_API_KEY). Set with teamshare-agent key set --key <key>; per-agent override lives on an agents[] entry. Never logged or printed in full
projects{ "<project-id>": { "path": "C:\\...", "guard": true } } — project guard links; managed with teamshare-agent link, never by hand

Environment variables

VariableDefaultUsed by
TEAMSHARE_API_URLhttps://api.teamshare.name.ng/All commands
TEAMSHARE_WS_URLwss://api.teamshare.name.ngDaemon WebSocket
LLM_BASE_URLhttps://api.openai.com/v1--self
LLM_API_KEY— (required)--self
LLM_MODELdeepseek-chat--self

Platform notes

PlatformTerminal spawnScheme registration
Windowscmd /c start cmd /k — detached window, stays open after the sessionHKCU\Software\Classes\teamshare via reg.exe (per-user)
macOSTerminal.app via osascript (always present) — real window, no installs needed~/Applications/TeamShareBridge.app (CFBundleURLTypes); open the bundle once to finish registration
Linux (desktop)xdg-terminal-exec → gnome-terminal → konsole → xterm (first one on PATH wins)~/.local/share/applications/teamshare-bridge.desktop + update-desktop-database
Linux (server / SSH)Headless fallback — session runs with no window; watch it via the web live consoleNot applicable (no deep-link UI)

The session window (or the web live console when running headless) shows the same output either way — the CLI heartbeats, streams its transcript to the backend, and reports the closing summary comment regardless of where the window lives. The bridge picks a working launcher automatically; you never configure it.

Troubleshooting

SymptomFix
EADDRINUSE on probe--port <candidate> or remove the port key; the website probes all candidates
Agent not configured locally on a deep linkteamshare-agent connect --agent <id> --key ts_...
No harness found on runInstall opencode or Claude, or use --self
Wake events never arriveteamshare-bridge status; daemon must be running with the key saved
Sessions blocked: "project … has no linked folder"The project guard refuses unlinked projects by design — link a folder: teamshare-agent link --project <id> --path <folder>, then assign/mention again
Probe shows agents: []teamshare-bridge add-agent --agent <id> --key ts_...
Session opens but exits instantlyRun teamshare-agent run … manually; check the API URL and key scopes

Build mode

The build command runs the build agent loop — it works through ready-for-dev tasks in strict order. The --draft flag lets the agent plan the queue from a free-text goal using an LLM.

examples
teamshare-agent build --project <id> --agent <id> --key ts_...

teamshare-agent build --project <id> --agent <id> --key ts_... --draft "Build a Next.js landing page"

teamshare-agent build --project <id> --agent <id> --key ts_... --draft "Build a REST API" --go
FlagPurpose
--draft "<goal>"Use an LLM to plan ready-for-dev tasks from a free-text goal
--draft "<goal>" --goPlan the queue and immediately start executing it
--dry-runShow what would be built without executing
--on-fail ask|stopWhat to do when a task fails (ask human or stop the build)
--blocked-waitWait for human answers instead of skipping blocked tasks

Prerequisites for --draft

The build agent must have a provider API key (teamshare-agent key set), a linked project folder (teamshare-agent link), and the bridge daemon running.