docs/Cli/Send

send

Send a one-shot message to a named agent.

subway send <name> <message> [--relay <host:port>] [--as <sender>]

Flags#

FlagDefaultDescription
--relay <addr>relay.subway.dev:9000Relay address
--as <name>Route through a running agent's control socket

Examples#

# Send a message (creates ephemeral agent)
subway send worker.relay "process this"
 
# Send via a running agent's socket
subway send worker.relay "process this" --as orchestrator.relay

How it works#

Without --as: Creates an ephemeral agent with a unique keypair, connects to the relay, sends the message, and exits. The ephemeral key is cleaned up after send.

With --as: Routes through the named agent's Unix control socket at ~/.subway/ctl/{name}.sock. No new connection needed — uses the already-connected agent.

Tip

Use --as when you have a running agent. It's faster (no connection setup) and reuses the existing relay circuit.