2026-01-01 15:37:45 +00:00
---
summary: "Signal support via signal-cli (JSON-RPC + SSE), setup, and number model"
read_when:
- Setting up Signal support
- Debugging Signal send/receive
---
2026-01-01 15:43:15 +01:00
# Signal (signal-cli)
Status: external CLI integration only. No libsignal embedding.
## Why
2026-01-04 14:32:47 +00:00
- Signal OSS stack is GPL/AGPL; not compatible with Clawdbot MIT if bundled.
2026-01-01 15:43:15 +01:00
- signal-cli is unofficial; must stay up to date (Signal server churn).
2026-01-01 15:37:45 +00:00
## The “number model” (important)
2026-01-04 14:32:47 +00:00
- Clawdbot is a **device** connected via `signal-cli` .
- If you run `signal-cli` on **your personal Signal account** , Clawdbot will **not** respond to messages sent from that same account (loop protection: ignore sender==account).
2026-01-01 15:37:45 +00:00
- Result: you **cannot** “text yourself” to chat with the AI.
- For “I text her, she texts me back” you want a **separate Signal account/number for the bot** :
- Bot number runs `signal-cli` (linked device)
- Your personal number is in `signal.allowFrom`
2026-01-04 14:32:47 +00:00
- You DM the bot number; Clawdbot replies back to you
2026-01-01 15:37:45 +00:00
2026-01-04 14:32:47 +00:00
You can still run Clawdbot on your own Signal account if your goal is “respond to other people as me”, but not for self-chat.
2026-01-01 15:37:45 +00:00
2026-01-01 15:43:15 +01:00
## Model
- Run `signal-cli` as separate process (user-installed).
- Prefer `daemon --http=127.0.0.1:PORT` for JSON-RPC + SSE.
- Alternative: `jsonRpc` mode over stdin/stdout.
2026-01-01 15:37:45 +00:00
## Quickstart (bot number)
1) Install `signal-cli` (keep Java installed).
2026-01-04 14:32:47 +00:00
- If you use the CLI wizard, it can auto-install to `~/.clawdbot/tools/signal-cli/...` .
2026-01-02 11:41:08 +00:00
- If you want a pinned version (example: `v0.13.22` ), install manually:
- Download the release asset for your platform from GitHub (tag `v0.13.22` ).
2026-01-04 14:32:47 +00:00
- Extract it somewhere stable (example: `~/.clawdbot/tools/signal-cli/0.13.22/` ).
2026-01-02 11:41:08 +00:00
- Set `signal.cliPath` to the extracted `signal-cli` binary path.
2026-01-01 15:37:45 +00:00
2) Link the bot account as a device:
2026-01-04 14:32:47 +00:00
- Run: `signal-cli link -n "Clawdbot"`
2026-01-01 15:37:45 +00:00
- Scan QR in Signal: Settings → Linked Devices → Link New Device
- Verify: `signal-cli listAccounts` includes the bot E.164
2026-01-04 14:32:47 +00:00
3) Configure `~/.clawdbot/clawdbot.json` :
2026-01-01 15:37:45 +00:00
```json5
{
signal: {
enabled: true,
account: "+15551234567", // bot number (recommended)
cliPath: "signal-cli",
autoStart: true,
httpHost: "127.0.0.1",
httpPort: 8080,
2026-01-06 06:40:42 +00:00
// Who is allowed to talk to the bot (DMs)
2026-01-06 17:51:38 +01:00
dmPolicy: "pairing", // pairing | allowlist | open | disabled
allowFrom: ["+15557654321"], // your personal number ("open" requires ["*"])
2026-01-06 06:40:42 +00:00
// Group policy + allowlist
groupPolicy: "open",
groupAllowFrom: ["+15557654321"]
2026-01-01 15:37:45 +00:00
}
}
```
4) Run gateway; sanity probe:
2026-01-04 14:32:47 +00:00
- `clawdbot gateway call providers.status --params '{"probe":true}'`
2026-01-01 15:37:45 +00:00
- Expect `signal.probe.ok=true` and `signal.probe.version` .
2026-01-04 14:32:47 +00:00
5) DM the bot number from your phone; Clawdbot replies.
2026-01-01 15:37:45 +00:00
2026-01-06 17:51:38 +01:00
## DM pairing
- Default: `signal.dmPolicy="pairing"` — unknown DM senders get a pairing code.
- Approve via: `clawdbot pairing approve --provider signal <code>` .
2026-01-02 11:41:08 +00:00
## “Do I need a separate number?”
- If you want “I text her and she texts me back”, yes: **use a separate Signal account/number for the bot** .
2026-01-04 14:32:47 +00:00
- Your personal account can run `signal-cli` , but you can’ t self-chat (Signal loop protection; Clawdbot ignores sender==account).
2026-01-02 11:41:08 +00:00
If you have a second phone:
- Create/activate the bot number on that phone.
2026-01-04 14:32:47 +00:00
- Run `signal-cli link -n "Clawdbot"` on your Mac, scan the QR on the bot phone.
2026-01-02 11:41:08 +00:00
- Put your personal number in `signal.allowFrom` , then DM the bot number from your personal phone.
2026-01-01 15:43:15 +01:00
## Endpoints (daemon --http)
- `POST /api/v1/rpc` JSON-RPC request (single or batch).
- `GET /api/v1/events` SSE stream of `receive` notifications.
- `GET /api/v1/check` health probe (200 = up).
## Multi-account
- Start daemon without `-a` .
- Include `params.account` (E164) on JSON-RPC calls.
- SSE `?account=+E164` filters events; no param = all accounts.
2026-01-02 11:41:08 +00:00
## Troubleshooting
- Gateway log coloring: `signal-cli: ...` lines are classified by severity; red means “treat this as an error”.
- `Failed to initialize HTTP Server` typically means the daemon can’ t bind the HTTP port (already in use). Stop the other daemon or change `signal.httpPort` .
2026-01-01 15:43:15 +01:00
## Minimal RPC surface
- `send` (recipient/groupId/username, message, attachments).
- `listGroups` (map group IDs).
- `subscribeReceive` / `unsubscribeReceive` (if manual receive).
- `startLink` / `finishLink` (optional device link flow).
2026-01-01 15:37:45 +00:00
## Addressing (send targets)
- Direct: `signal:+15551234567` (or plain `+15551234567` )
2026-01-02 10:14:58 +01:00
- Groups: `signal:group:<groupId>`
2026-01-01 15:37:45 +00:00
- Usernames: `username:<name>` / `u:<name>`
2026-01-04 14:32:47 +00:00
## Process plan (Clawdbot adapter)
2026-01-01 15:43:15 +01:00
1) Detect `signal-cli` binary; refuse if missing.
2) Launch daemon (HTTP preferred), store PID.
3) Poll `/api/v1/check` until ready.
4) Open SSE stream; parse `event: receive` .
2026-01-06 18:25:52 +00:00
5) Translate receive payload into Clawdbot provider model.
2026-01-01 15:43:15 +01:00
6) On SSE disconnect, backoff + reconnect.
## Storage
- signal-cli data lives in `$XDG_DATA_HOME/signal-cli/data` or
`$HOME/.local/share/signal-cli/data` .
## References (local)
- `~/Projects/oss/signal-cli/README.md`
- `~/Projects/oss/signal-cli/man/signal-cli-jsonrpc.5.adoc`
- `~/Projects/oss/signal-cli/src/main/java/org/asamk/signal/http/HttpServerHandler.java`
- `~/Projects/oss/signal-cli/src/main/java/org/asamk/signal/jsonrpc/SignalJsonRpcDispatcherHandler.java`