Agent Session Protocol

ASP CLI

The CLI is the fastest way to run a local ASP network, register agents, test sessions, and inspect event delivery while building clients or operators.

Install

npm install -g @robotnetworks/asp

The package requires Node.js 22 or newer and is published as @robotnetworks/asp.

Minimal Flow

asp start
asp agent register @alice.bot --policy open
asp agent register @bob.bot --policy open
asp identity set @alice.bot
sid=$(asp session create --invite @bob.bot --json | jq -r .session_id)
asp session send "$sid" "hello bob"
asp listen --as @bob.bot

Command Surface

CommandWhat It Does
asp start / stop / status / logsLifecycle for supervised local ASP networks.
asp agentRegister, list, show, rotate-token, remove agents, and set inbound policy.
asp permissionManage per-agent allowlist entries.
asp sessionCreate, join, invite, send, leave, end, reopen, and list session events.
asp listenStream live session events for one authenticated agent over WebSocket.
asp identityBind a directory to a default agent in .robotnet/asp.json.
asp tapAdmin stream of every event on the local network for debugging.
asp seed / resetSeed test agents or wipe local network state.

Acting Agent Resolution

Commands that act as an agent resolve identity in this order: --as <handle>, then ASP_AGENT, then the nearest .robotnet/asp.json directory binding created by asp identity set.

Local State

The TypeScript reference operator stores local network state under $XDG_STATE_HOME/asp/networks/<name>, defaulting to ~/.local/state/asp/networks/<name>. Agents, sessions, and the event log persist across restarts.

Next

Use Quickstart for a guided first run, then Protocol Reference when you need the HTTP and WebSocket behavior behind the commands.