dingtalk-bridge

DingTalk group chat bridge for Claude Code. Send markdown/text messages to DingTalk groups, receive @mentions and auto-execute via Claude CLI, run a 24/7 Stream bot. Triggers: dingtalk, send dingtalk, dingtalk bot, dingtalk message, send group message, 钉钉, 发群消息, 钉钉机器人

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "dingtalk-bridge" with this command: npx skills add mguozhen/dingtalk-bridge

DingTalk Bridge Skill

Bridges Claude Code with DingTalk group chat via the DingTalk Stream SDK + OpenAPI.

Capabilities

FeatureDescription
Send MarkdownSend rich markdown messages to a DingTalk group
Send TextSend plain text messages
Stream Bot24/7 listener: receive @mentions, execute via claude -p, reply with results
Auto Conv DiscoveryConversation ID auto-saved on first @mention
Keepalive20s WebSocket ping prevents DingTalk 30-min timeout
Crash RecoveryExponential backoff (5s to 60s) on disconnect

Quick Start

1. Install

bash "$CLAUDE_SKILL_DIR/scripts/install.sh"

The script will:

  • Install Python dependencies (dingtalk_stream, websockets)
  • Prompt for your DingTalk App Key & Secret (or read from env)
  • Generate config.json
  • Create data/ directory for conversation state
  • Optionally create a macOS LaunchAgent for 24/7 operation

2. Configure

Set credentials via environment variables (recommended):

export DINGTALK_APP_KEY="your_app_key"
export DINGTALK_APP_SECRET="your_app_secret"
export DINGTALK_WORKDIR="/path/to/your/project"  # optional

Or edit config.json in the skill directory (see config.example.json).

3. Get Conversation ID

The bot needs a conversation ID to send messages. Two ways:

Auto (recommended): Start the Stream bot, then @mention it in a DingTalk group. The conv ID is saved automatically.

Manual: If you already have the openConversationId and robotCode:

mkdir -p "$CLAUDE_SKILL_DIR/data"
echo '{"openConversationId":"YOUR_ID","robotCode":"YOUR_ROBOT_CODE"}' > "$CLAUDE_SKILL_DIR/data/conv.json"

Commands

Send a message

# Markdown (default)
python3 "$CLAUDE_SKILL_DIR/src/send.py" "**Bold** message with markdown"

# With custom title
python3 "$CLAUDE_SKILL_DIR/src/send.py" --title "Alert" "Server is down!"

# Plain text
python3 "$CLAUDE_SKILL_DIR/src/send.py" --text "Plain text message"

Start the Stream Bot

python3 "$CLAUDE_SKILL_DIR/src/stream_bot.py"

The bot will:

  1. Connect to DingTalk via Stream protocol
  2. Listen for all @mentions in groups where the bot is added
  3. Execute the message content via claude -p "<message>" --continue
  4. Reply with the result as a markdown message

Use as Python module

import sys
sys.path.insert(0, "/path/to/dingtalk-bridge/src")
from send import send_markdown, send_text

send_markdown("Daily Report", "**Sent:** 50\n**Opened:** 18\n**Clicked:** 7")
send_text("Simple notification")

Configuration Reference

Config KeyEnv VarDefaultDescription
app_keyDINGTALK_APP_KEY(required)DingTalk App Key
app_secretDINGTALK_APP_SECRET(required)DingTalk App Secret
conv_fileDINGTALK_CONV_FILE<skill>/data/conv.jsonConversation metadata path
workdirDINGTALK_WORKDIRcwdWorking directory for claude CLI
claude_binDINGTALK_CLAUDE_BINclaudePath to claude binary
max_replyDINGTALK_MAX_REPLY3000Max reply length (chars)
keepaliveDINGTALK_KEEPALIVE20WebSocket keepalive interval (seconds)

DingTalk App Setup (Prerequisites)

  1. Go to DingTalk Open Platform
  2. Create an Enterprise Internal App (企业内部应用)
  3. Enable Robot capability (机器人)
  4. Set message receive mode to Stream (Stream 模式)
  5. Copy the App Key and App Secret
  6. Add the bot to a group chat

Running Tests

python3 "$CLAUDE_SKILL_DIR/tests/test_dingtalk.py"

Architecture

dingtalk-bridge/
├── SKILL.md              # This file
├── config.example.json   # Example configuration
├── config.json           # Your config (gitignored)
├── data/
│   └── conv.json         # Auto-saved conversation metadata
├── src/
│   ├── __init__.py
│   ├── config.py         # Config loader (env > file > defaults)
│   ├── send.py           # Send messages (OpenAPI)
│   └── stream_bot.py     # Stream bot (receive + execute + reply)
├── scripts/
│   └── install.sh        # One-command setup
└── tests/
    └── test_dingtalk.py  # Regression tests

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Webhook Notify

通用Webhook通知工具,支持钉钉、企业微信、飞书、Slack、Discord、Teams、Telegram、自定义HTTP等多种平台。提供统一接口、自动平台识别、配置管理、模板系统、重试机制等高级功能。适用于告警通知、自动化触发、系统监控、CI/CD通知等场景。

Registry SourceRecently Updated
2991Profile unavailable
Automation

DingTalk Push

Send Markdown-formatted messages with type and @mentions to DingTalk group chats via bot webhook with optional signature verification.

Registry SourceRecently Updated
1.6K1Profile unavailable
General

Dingtalk Csa

钉盘助手 (DingTalk Cloud Storage Assistant) - 管理钉钉云盘空间、文件和文档。用当用户要求读写钉盘文件、管理团队空间、上传下载文档、操作adoc文档时触发。也适用于钉钉文件分析、报告生成、团队协作等场景。触发词:钉盘、钉钉云盘、DingTalk storage、钉钉文件、钉钉文档。

Registry SourceRecently Updated
970Profile unavailable
General

WeChat Sender by dxx

通过OpenClaw微信通道主动发送文字、图片和文件消息,支持单发、定时和批量推送,需联系人已存在聊天记录。

Registry SourceRecently Updated
840Profile unavailable