agentbridge CLI
agentbridge is the command-line interface for the agentbridge general-purpose
agent interconnect. It registers agents (CLI coding tools like Claude Code,
Copilot, Codex, Cursor Agent, or any subprocess that speaks the agentbridge
JSON protocol) as live A2A services, lists them via DIR discovery, hands off
context between them, and coordinates them autonomously toward a shared goal.
Install
Commands
register — start an adapter server
Wrap a CLI tool as an agentbridge adapter and keep it running as a SLIM A2A service so remote callers can reach it.
# Wrap any subprocess that speaks the agentbridge JSON protocol
# Start a Claude Code adapter
# Start a Copilot adapter
# Start a Codex adapter
# Publish an OASF record to the Agent Directory after registering
Supported --tool values: generic-stdio, claude-code, copilot, codex.
Note:
cursor-agentis available as a spec incoordinate --agentsbut does not have a standaloneregisterlistener yet.
list — discover registered adapters
# Query DIR for registered adapters
# Query the running local SLIM node only
handoff — transfer context from one tool to another
Snapshot the current session from a source tool and inject it into a destination tool. Both tools must be running and speaking the agentbridge JSON protocol.
# Basic handoff using subprocess commands directly
# Save the captured ContextPacket for recovery
# Resume from a previously saved ContextPacket
delegate — send a single task to a remote adapter
Dispatch one prompt to a remote agentbridge adapter over A2A/SLIM and print the response.
coordinate — autonomous multi-round coordination
Run MasRuntime<DevelopmentEngine> across a set of agents until a winning code
artifact is produced. Agents propose, vote, and converge without human mediation.
# Local agents (in-process subprocess adapters)
# Remote agents over SLIM A2A (register each in a separate terminal first)
# Require explicit human approval before accepting the result
Agent spec formats for --agents:
| Format | Meaning |
|---|---|
claude-code |
Local Claude Code adapter |
copilot |
Local Copilot CLI adapter |
codex |
Local Codex CLI adapter |
cursor-agent |
Local Cursor Agent adapter |
generic-stdio:<cmd> |
Local subprocess adapter |
slim:<agent-id> |
Remote adapter over SLIM (uses --slim-endpoint) |
slim:<agent-id>@<host:port> |
Remote adapter at explicit endpoint |
Subprocess protocol
Any process can participate in a handoff if it reads JSON from stdin and writes JSON to stdout:
stdin: {"cmd":"snapshot"}
stdout: {"ok":true,"data":{... ContextPacket JSON ...}}
stdin: {"cmd":"inject","context":{... ContextPacket JSON ...}}
stdout: {"ok":true}
stdin: {"cmd":"execute","prompt":"write a parser"}
stdout: {"ok":true,"data":"fn parse(...) { ... }"}
Environment variables
| Variable | Default | Purpose |
|---|---|---|
SLIM_ENDPOINT |
127.0.0.1:47357 |
SLIM node address |
SHADI_AGENT_ID |
avatar |
Agent identity for SLIM/DIR |
SHADI_SLIM_AUTH |
— | Must be did — see below |
SLIM_HUMAN_SEED |
— | Human root secret DID keys are derived from |
SLIM_MEMBER_DIDS |
— | Comma-separated did:key allow-list |
SLIM_TLS_CERT / SLIM_TLS_KEY |
— | mTLS client certificate paths |
SLIM_TLS_CA |
— | CA certificate for server verification |
⚠️ Security:
register,delegate, andcoordinate(forslim:agent specs) authenticate to the SLIM mesh via DID/keys only — setSHADI_SLIM_AUTH=did,SLIM_HUMAN_SEED, andSLIM_MEMBER_DIDS(seedocs/content/demos/demo-env.sh). Shared secrets are not supported: aregisterlistener forwards incoming A2A tasks to the local CLI tool, so admission must be cryptographic, not a symmetric secret compiled into every demo script.
Live SLIM demo (4 terminals)
See scripts/agentbridge_shell*.sh for a ready-made 4-terminal
demo that starts a SLIM node, registers Copilot and Codex as A2A services, and
runs coordinate against them.