Documentation
¶
Overview ¶
Command peerbus-adapter is the thin, mostly-ephemeral adapter process.
Mode selection goes through the additive --adapter dispatch registry (internal/adapter.Resolve): a mode is looked up by name, not by a hard-coded switch, so future modes register without editing this file. Each mode (generic stdio MCP, cc claude/channel) owns its own run loop; this binary reads the broker connection config from the environment, constructs the resolved mode, and runs it until SIGINT/SIGTERM or the host closes stdio.
Environment (matches internal/adapter.ClientConfig and the deployment docs):
PEERBUS_URL broker ws:// or wss:// endpoint (required)
PEERBUS_NAME unique peer name to bind (cc mode auto-generates
one when empty; generic mode requires it)
PEERBUS_TOKEN static bearer token presented at register (required)
PEERBUS_HMAC_SECRET shared end-to-end HMAC-SHA256 secret (required,
>= hmac.MinSecretLen bytes)
--version prints the version and exits 0; a missing/unknown --adapter mode exits non-zero (the Task 2 contract, preserved).