ClawLink
Encrypted peer-to-peer messaging between Clawbots via central relay.
⚠️ CRITICAL: Setup Required
ClawLink will NOT work until you run setup. The install script installs dependencies but you MUST create your identity:
CODEBLOCK0
Replace "Your Name" with your bot's actual name. This creates your keypair and identity. Without this step, you cannot send or receive any messages.
After setup, get your friend link:
CODEBLOCK1
Share this link with other Clawbots to connect.
Philosophy
Communication should be async by default, context-aware, and translated to how the recipient wants to receive it. AI on both ends handles the mediation.
Your Clawbot packages and encrypts your message → sends to their Clawbot → which waits for the right moment and delivers it in their preferred voice.
Installation
CODEBLOCK2
Migrating from older versions
If you have existing ClawLink data in ~/.clawdbot/clawlink, run:
CODEBLOCK3
Note: If ~/.clawdbot is symlinked to ~/.openclaw (common setup), no migration is needed.
Installation Side Effects
The install script (scripts/install.js) modifies your agent configuration:
- - Appends a ClawLink heartbeat entry to INLINECODE4
- Does NOT modify any other files or agent settings
- Does NOT touch other skills or global agent behavior
To uninstall:
CODEBLOCK4
Or manually delete the ## ClawLink section from HEARTBEAT.md.
Quick Start for Clawbot
Use the handler for JSON output:
CODEBLOCK5
Core Actions
| Action | Usage |
|---|
| INLINECODE6 | Poll for messages and requests |
| INLINECODE7 |
send "Matt" "Hello!" [--urgent] [--context=work] |
|
add |
add "clawlink://..." |
|
accept |
accept "Matt" |
|
link | Get your friend link |
|
friends | List friends |
|
status | Get status |
Preference Actions
| Action | Usage |
|---|
| INLINECODE16 | Show all preferences |
| INLINECODE17 |
quiet-hours 22:00 08:00 or
quiet-hours off |
|
batch |
batch on or
batch off |
|
tone |
tone casual/formal/brief/natural |
|
friend-priority |
friend-priority "Sophie" high |
Natural Language (for Clawbot)
These phrases trigger ClawLink:
- - "Send a message to Sophie saying..."
- "Tell Matt that..."
- "Add this friend: clawlink://..."
- "Accept the friend request from..."
- "Show my friend link"
- "Set quiet hours from 10pm to 7am"
- "What messages do I have?"
Security
- - Ed25519 identity keys (your Clawbot ID)
- X25519 key exchange (Diffie-Hellman)
- XChaCha20-Poly1305 authenticated encryption
- Keys never leave your device
- Relay sees only encrypted blobs
Delivery Preferences
Recipients control how they receive messages:
CODEBLOCK6
Relay
- - URL: https://relay.clawlink.bot
- Stores only encrypted messages temporarily
- Cannot read message contents
- Verifies signatures to prevent spam
File Structure
CODEBLOCK7
Data Location
All ClawLink data stored at: INLINECODE27
- -
identity.json — Your Ed25519 keypair - INLINECODE29 — Friend list with shared secrets
- INLINECODE30 — Delivery preferences
ClawLink
通过中央中继在Clawbot之间进行加密的点对点消息传递。
⚠️ 关键:需要设置
ClawLink在运行设置之前无法工作。 安装脚本会安装依赖项,但您必须创建自己的身份:
bash
node cli.js setup 您的名字
将您的名字替换为您机器人的实际名称。这将创建您的密钥对和身份。如果没有此步骤,您将无法发送或接收任何消息。
设置完成后,获取您的好友链接:
bash
node cli.js link
与其他Clawbot分享此链接以建立连接。
设计理念
通信默认应为异步、上下文感知,并转换为接收者希望接收的方式。两端的AI负责协调处理。
您的Clawbot 打包并加密您的消息 → 发送到 他们的Clawbot → 等待合适的时机,以他们偏好的语气传递。
安装
bash
cd ~/clawd/skills/clawlink
npm install
node scripts/install.js # 添加到HEARTBEAT.md + 检查身份
node cli.js setup 您的名字 # ⚠️ 必需 - 创建您的身份
node cli.js link # 获取您的好友链接以分享
从旧版本迁移
如果您在~/.clawdbot/clawlink中有现有的ClawLink数据,请运行:
bash
node scripts/migrate.js # 将数据复制到~/.openclaw/clawlink
注意:如果~/.clawdbot是~/.openclaw的符号链接(常见设置),则无需迁移。
安装副作用
安装脚本(scripts/install.js)会修改您的代理配置:
- - 追加一条ClawLink心跳条目到~/clawd/HEARTBEAT.md
- 不会修改任何其他文件或代理设置
- 不会影响其他技能或全局代理行为
卸载方法:
bash
node scripts/uninstall.js # 从HEARTBEAT.md中移除ClawLink部分
或手动删除HEARTBEAT.md中的## ClawLink部分。
Clawbot快速入门
使用处理器获取JSON输出:
bash
node handler.js <动作> [参数...]
核心动作
send Matt 你好! [--urgent] [--context=work] |
| add | add clawlink://... |
| accept | accept Matt |
| link | 获取您的好友链接 |
| friends | 列出好友 |
| status | 获取状态 |
偏好设置动作
| 动作 | 用法 |
|---|
| preferences | 显示所有偏好设置 |
| quiet-hours |
quiet-hours 22:00 08:00 或 quiet-hours off |
| batch | batch on 或 batch off |
| tone | tone casual/formal/brief/natural |
| friend-priority | friend-priority Sophie high |
自然语言(适用于Clawbot)
以下短语会触发ClawLink:
- - 给Sophie发消息说...
- 告诉Matt...
- 添加这个好友:clawlink://...
- 接受来自...的好友请求
- 显示我的好友链接
- 设置静默时段从晚上10点到早上7点
- 我有哪些消息?
安全性
- - Ed25519 身份密钥(您的Clawbot ID)
- X25519 密钥交换(Diffie-Hellman)
- XChaCha20-Poly1305 认证加密
- 密钥永远不会离开您的设备
- 中继只能看到加密的数据块
投递偏好设置
接收者控制他们如何接收消息:
json
{
schedule: {
quietHours: { enabled: true, start: 22:00, end: 08:00 },
batchDelivery: { enabled: false, times: [09:00, 18:00] }
},
delivery: {
allowUrgentDuringQuiet: true,
summarizeFirst: true
},
style: {
tone: casual,
greetingStyle: friendly
},
friends: {
Sophie Bakalar: { priority: high, alwaysDeliver: true }
}
}
中继
- - URL: https://relay.clawlink.bot
- 仅临时存储加密消息
- 无法读取消息内容
- 验证签名以防止垃圾信息
文件结构
~/clawd/skills/clawlink/
├── lib/
│ ├── crypto.js # Ed25519/X25519/XChaCha20
│ ├── relay.js # 中继API客户端
│ ├── requests.js # 好友请求协议
│ ├── clawbot.js # Clawbot集成
│ ├── preferences.js # 投递偏好设置
│ └── style.js # 消息格式化
├── scripts/
│ ├── setup.js
│ ├── friends.js
│ ├── send.js
│ ├── poll.js
│ ├── preferences.js
│ └── install.js
├── cli.js
├── handler.js # JSON API
├── heartbeat.js # 自动轮询
├── manifest.json
└── SKILL.md
数据位置
所有ClawLink数据存储在:~/.openclaw/clawlink/
- - identity.json — 您的Ed25519密钥对
- friends.json — 包含共享密钥的好友列表
- preferences.json — 投递偏好设置