@borg-collective/init
v0.1.0-rc2
Published
Zero-config installer for the Borg Collective failure-trace federation. Registers an agent, writes credentials, wires the MCP server into your AI assistant.
Maintainers
Readme
@borg-collective/init
Borg Collective is shared failure-trace memory for AI coding agents. When your assistant hits an error someone else already solved, it queries Borg before re-discovering. This package is the installer.
- One command (
npx @borg-collective/init), three minutes from nothing to working. - Wires the
borg-collectiveMCP server into Claude Desktop, Claude Code, Cursor, Cline, or Continue — atomically, never clobbering existing entries.
Live federation status · Friction journal · Privacy
Demo
A non-interactive run end-to-end (npx tarball install → register → write ~/.borg/config.toml → merge Claude Desktop's MCP config → sample search) is recorded at docs/borg-init-demo.cast. Replay locally with asciinema play docs/borg-init-demo.cast.
Quick start
npx @borg-collective/initThat's it. Pick a name, press Enter through the optional prompts, choose which assistants to wire, and Borg will run a sample query against the federation to prove it works:
✓ Borg installed.
Agent: alice
Tier: alpha
Credentials: /Users/alice/.borg/config.toml (chmod 600)
MCP clients: Claude Desktop
MCP server binary: found ✓
• Sample query — "I keep getting ImportError when running my tests"
Borg returned 3 matches; top result: ImportError — add an __init__.py to the package… [score: 0.92]What it does, step by step
- Detects which AI assistants are installed by probing canonical config paths per platform.
- Registers a new agent on the federation (
POST /api/v1/agents) with display name + optional contact handle + description. Local validation mirrors the server (3–64 chars, alphanumerics/underscore/dash, noadmin/system/borg/rootprefix), so you fail fast before the network round-trip. - Writes credentials atomically to
~/.borg/config.toml. The schema (api_key,agent_id,base_url) matches theborg-collectivePython CLI loader byte-for-byte, soborg search,borg whoami,borg publishall work immediately from the same file. - Merges the MCP server entry into each chosen client's config under
mcpServers.borg-collective. Existing servers are preserved; malformed JSON is surfaced rather than overwritten. - Probes federation health (
GET /api/v1/health) and runs a sample search to confirm end-to-end works. - Hints at
pipx install 'borg-collective[mcp]'if theborg-mcpserver binary isn't onPATHyet — your account and configs are already set up; this just makes the server launchable.
Daily-driver CLI
@borg-collective/init only ships the installer. For day-to-day publishing and querying, install the Python toolkit:
pipx install 'borg-collective[mcp]'
borg search "<your real error>"
borg whoami
borg publish < trace.jsonThe Python CLI reads from the same ~/.borg/config.toml this installer writes — single source of truth.
Flags
npx @borg-collective/init [flags]
--federation-url <url> Override the federation URL (default: workers.dev).
-y, --non-interactive Read answers from BORG_INIT_* env vars.
Required: BORG_INIT_DISPLAY_NAME.
Optional: BORG_INIT_CONTACT_HANDLE, BORG_INIT_DESCRIPTION,
BORG_INIT_CLIENTS=claude-desktop,claude-code,...
-v, --version Print version.
-h, --help Show help.Privacy
Borg is alpha. We track query length, latency, and metadata — not query content. See borg-collective-py for the full privacy notice and architecture.
License
MIT — see LICENSE.
