2026-01-02 01:19:22 +01:00
|
|
|
---
|
2026-02-03 18:06:54 -08:00
|
|
|
summary: "RPC adapters for external CLIs (signal-cli, legacy imsg) and gateway patterns"
|
2026-01-02 01:19:22 +01:00
|
|
|
read_when:
|
|
|
|
|
- Adding or changing external CLI integrations
|
|
|
|
|
- Debugging RPC adapters (signal-cli, imsg)
|
2026-01-31 16:04:03 -05:00
|
|
|
title: "RPC Adapters"
|
2026-01-02 01:19:22 +01:00
|
|
|
---
|
2026-01-31 21:13:13 +09:00
|
|
|
|
2026-01-02 01:19:22 +01:00
|
|
|
# RPC adapters
|
|
|
|
|
|
2026-01-30 03:15:10 +01:00
|
|
|
OpenClaw integrates external CLIs via JSON-RPC. Two patterns are used today.
|
2026-01-02 01:19:22 +01:00
|
|
|
|
|
|
|
|
## Pattern A: HTTP daemon (signal-cli)
|
2026-01-31 21:13:13 +09:00
|
|
|
|
2026-01-02 01:19:22 +01:00
|
|
|
- `signal-cli` runs as a daemon with JSON-RPC over HTTP.
|
|
|
|
|
- Event stream is SSE (`/api/v1/events`).
|
|
|
|
|
- Health probe: `/api/v1/check`.
|
2026-01-30 03:15:10 +01:00
|
|
|
- OpenClaw owns lifecycle when `channels.signal.autoStart=true`.
|
2026-01-02 01:19:22 +01:00
|
|
|
|
2026-01-13 06:16:43 +00:00
|
|
|
See [Signal](/channels/signal) for setup and endpoints.
|
2026-01-02 01:19:22 +01:00
|
|
|
|
2026-02-03 18:06:54 -08:00
|
|
|
## Pattern B: stdio child process (legacy: imsg)
|
2026-01-31 21:13:13 +09:00
|
|
|
|
2026-02-03 18:06:54 -08:00
|
|
|
> **Note:** For new iMessage setups, use [BlueBubbles](/channels/bluebubbles) instead.
|
|
|
|
|
|
|
|
|
|
- OpenClaw spawns `imsg rpc` as a child process (legacy iMessage integration).
|
2026-01-02 01:19:22 +01:00
|
|
|
- JSON-RPC is line-delimited over stdin/stdout (one JSON object per line).
|
|
|
|
|
- No TCP port, no daemon required.
|
|
|
|
|
|
|
|
|
|
Core methods used:
|
2026-01-31 21:13:13 +09:00
|
|
|
|
2026-01-02 01:19:22 +01:00
|
|
|
- `watch.subscribe` → notifications (`method: "message"`)
|
|
|
|
|
- `watch.unsubscribe`
|
|
|
|
|
- `send`
|
|
|
|
|
- `chats.list` (probe/diagnostics)
|
|
|
|
|
|
2026-02-03 18:06:54 -08:00
|
|
|
See [iMessage](/channels/imessage) for legacy setup and addressing (`chat_id` preferred).
|
2026-01-02 01:19:22 +01:00
|
|
|
|
|
|
|
|
## Adapter guidelines
|
2026-01-31 21:13:13 +09:00
|
|
|
|
2026-01-02 01:19:22 +01:00
|
|
|
- Gateway owns the process (start/stop tied to provider lifecycle).
|
|
|
|
|
- Keep RPC clients resilient: timeouts, restart on exit.
|
|
|
|
|
- Prefer stable IDs (e.g., `chat_id`) over display strings.
|