fix(pairing): accept positional provider args

This commit is contained in:
Peter Steinberger
2026-01-10 16:36:43 +01:00
parent 41c8bdfada
commit 81f9093c3c
23 changed files with 112 additions and 52 deletions

View File

@@ -285,8 +285,8 @@ Tip: use `npx clawdhub` to search, install, and sync skills.
Approve DM pairing requests across providers.
Subcommands:
- `pairing list --provider <telegram|signal|imessage|discord|slack|whatsapp> [--json]`
- `pairing approve --provider <...> <code> [--notify]`
- `pairing list <provider> [--json]`
- `pairing approve <provider> <code> [--notify]`
### `hooks gmail`
Gmail Pub/Sub hook setup + runner. See [/automation/gmail-pubsub](/automation/gmail-pubsub).

View File

@@ -251,8 +251,8 @@ Controls how WhatsApp direct chats (DMs) are handled:
Pairing codes expire after 1 hour; the bot only sends a pairing code when a new request is created. Pending DM pairing requests are capped at **3 per provider** by default.
Pairing approvals:
- `clawdbot pairing list --provider whatsapp`
- `clawdbot pairing approve --provider whatsapp <code>`
- `clawdbot pairing list whatsapp`
- `clawdbot pairing approve whatsapp <code>`
### `whatsapp.allowFrom`

View File

@@ -46,8 +46,8 @@ All current DM-capable providers support a DM policy (`dmPolicy` or `*.dm.policy
Approve via CLI:
```bash
clawdbot pairing list --provider <provider>
clawdbot pairing approve --provider <provider> <code>
clawdbot pairing list <provider>
clawdbot pairing approve <provider> <code>
```
Details + files on disk: [Pairing](/start/pairing)

View File

@@ -175,7 +175,7 @@ If `dmPolicy` is `pairing`, unknown senders should receive a code and their mess
**Check 1:** Is a pending request already waiting?
```bash
clawdbot pairing list --provider <provider>
clawdbot pairing list <provider>
```
Pending DM pairing requests are capped at **3 per provider** by default. If the list is full, new requests wont generate a code until one is approved or expires.

View File

@@ -22,7 +22,7 @@ Status: ready for DM and guild text channels via the official Discord bot gatewa
- If you prefer env vars, still add `discord: { enabled: true }` to `~/.clawdbot/clawdbot.json` and set `DISCORD_BOT_TOKEN`.
5. Direct chats: use `user:<id>` (or a `<@id>` mention) when delivering; all turns land in the shared `main` session. Bare numeric IDs are ambiguous and rejected.
6. Guild channels: use `channel:<channelId>` for delivery. Mentions are required by default and can be set per guild or per channel.
7. Direct chats: secure by default via `discord.dm.policy` (default: `"pairing"`). Unknown senders get a pairing code (expires after 1 hour); approve via `clawdbot pairing approve --provider discord <code>`.
7. Direct chats: secure by default via `discord.dm.policy` (default: `"pairing"`). Unknown senders get a pairing code (expires after 1 hour); approve via `clawdbot pairing approve discord <code>`.
- To keep old “open to anyone” behavior: set `discord.dm.policy="open"` and `discord.dm.allowFrom=["*"]`.
- To hard-allowlist: set `discord.dm.policy="allowlist"` and list senders in `discord.dm.allowFrom`.
- To ignore all DMs: set `discord.dm.enabled=false` or `discord.dm.policy="disabled"`.

View File

@@ -86,8 +86,8 @@ DMs:
- Default: `imessage.dmPolicy = "pairing"`.
- Unknown senders receive a pairing code; messages are ignored until approved (codes expire after 1 hour).
- Approve via:
- `clawdbot pairing list --provider imessage`
- `clawdbot pairing approve --provider imessage <CODE>`
- `clawdbot pairing list imessage`
- `clawdbot pairing approve imessage <CODE>`
- Pairing is the default token exchange for iMessage DMs. Details: [Pairing](/start/pairing)
Groups:

View File

@@ -45,8 +45,8 @@ DMs:
- Default: `signal.dmPolicy = "pairing"`.
- Unknown senders receive a pairing code; messages are ignored until approved (codes expire after 1 hour).
- Approve via:
- `clawdbot pairing list --provider signal`
- `clawdbot pairing approve --provider signal <CODE>`
- `clawdbot pairing list signal`
- `clawdbot pairing approve signal <CODE>`
- Pairing is the default token exchange for Signal DMs. Details: [Pairing](/start/pairing)
- UUID-only senders (from `sourceUuid`) are stored as `uuid:<id>` in `signal.allowFrom`.

View File

@@ -224,7 +224,7 @@ For fine-grained control, use these tags in agent responses:
## DM security (pairing)
- Default: `slack.dm.policy="pairing"` — unknown DM senders get a pairing code (expires after 1 hour).
- Approve via: `clawdbot pairing approve --provider slack <code>`.
- Approve via: `clawdbot pairing approve slack <code>`.
- To allow anyone: set `slack.dm.policy="open"` and `slack.dm.allowFrom=["*"]`.
## Group policy

View File

@@ -151,8 +151,8 @@ Private topics (DM forum mode) also include `message_thread_id`. Clawdbot:
### DM access
- Default: `telegram.dmPolicy = "pairing"`. Unknown senders receive a pairing code; messages are ignored until approved (codes expire after 1 hour).
- Approve via:
- `clawdbot pairing list --provider telegram`
- `clawdbot pairing approve --provider telegram <CODE>`
- `clawdbot pairing list telegram`
- `clawdbot pairing approve telegram <CODE>`
- Pairing is the default token exchange used for Telegram DMs. Details: [Pairing](/start/pairing)
### Group access

View File

@@ -39,7 +39,7 @@ Use a **separate phone number** for Clawdbot. Best UX, clean routing, no self-ch
**Pairing mode (optional):**
If you want pairing instead of allowlist, set `whatsapp.dmPolicy` to `pairing`. Unknown senders get a pairing code; approve with:
`clawdbot pairing approve --provider whatsapp <code>`
`clawdbot pairing approve whatsapp <code>`
### Personal number (fallback)
Quick fallback: run Clawdbot on **your own number**. Message yourself (WhatsApp “Message yourself”) for testing so you dont spam contacts. Expect to read verification codes on your main phone during setup and experiments. **Must enable self-chat mode.**
@@ -95,7 +95,7 @@ on outbound replies.
- Status/broadcast chats are ignored.
- Direct chats use E.164; groups use group JID.
- **DM policy**: `whatsapp.dmPolicy` controls direct chat access (default: `pairing`).
- Pairing: unknown senders get a pairing code (approve via `clawdbot pairing approve --provider whatsapp <code>`; codes expire after 1 hour).
- Pairing: unknown senders get a pairing code (approve via `clawdbot pairing approve whatsapp <code>`; codes expire after 1 hour).
- Open: requires `whatsapp.allowFrom` to include `"*"`.
- Self messages are always allowed; “self-chat mode” still requires `whatsapp.allowFrom` to include your own number.

View File

@@ -631,8 +631,8 @@ Treat inbound DMs as untrusted input. Defaults are designed to reduce risk:
- Default behavior on DMcapable providers is **pairing**:
- Unknown senders receive a pairing code; the bot does not process their message.
- Approve with: `clawdbot pairing approve --provider <provider> <code>`
- Pending requests are capped at **3 per provider**; check `clawdbot pairing list --provider <provider>` if a code didnt arrive.
- Approve with: `clawdbot pairing approve <provider> <code>`
- Pending requests are capped at **3 per provider**; check `clawdbot pairing list <provider>` if a code didnt arrive.
- Opening DMs publicly requires explicit optin (`dmPolicy: "open"` and allowlist `"*"`).
Run `clawdbot doctor` to surface risky DM policies.

View File

@@ -128,8 +128,8 @@ Default posture: unknown DMs get a short code and messages are not processed unt
If your first DM gets no reply, approve the pairing:
```bash
clawdbot pairing list --provider whatsapp
clawdbot pairing approve --provider whatsapp <code>
clawdbot pairing list whatsapp
clawdbot pairing approve whatsapp <code>
```
Pairing doc: [Pairing](/start/pairing)

View File

@@ -30,8 +30,8 @@ Pairing codes:
### Approve a sender
```bash
clawdbot pairing list --provider telegram
clawdbot pairing approve --provider telegram <CODE>
clawdbot pairing list telegram
clawdbot pairing approve telegram <CODE>
```
Supported providers: `telegram`, `whatsapp`, `signal`, `imessage`, `discord`, `slack`.

View File

@@ -103,7 +103,7 @@ Tip: `--json` does **not** imply non-interactive mode. Use `--non-interactive` (
- Discord: bot token.
- Signal: optional `signal-cli` install + account config.
- iMessage: local `imsg` CLI path + DB access.
- DM security: default is pairing. First DM sends a code; approve via `clawdbot pairing approve --provider <provider> <code>` or use allowlists.
- DM security: default is pairing. First DM sends a code; approve via `clawdbot pairing approve <provider> <code>` or use allowlists.
6) **Daemon install**
- macOS: LaunchAgent