← Back to Skills Marketplace
shaoyunhao0107

DingTalk Channel Setup

by shaoyunhao0107 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
1346
Downloads
1
Stars
13
Active Installs
1
Versions
Install in OpenClaw
/install dingtalk-setup
Description
钉钉企业内部机器人渠道快速对接。Use when: 用户需要对接钉钉渠道、配置钉钉 Stream 模式、排查钉钉消息问题。NOT for: 飞书/Lark、企业微信等其他平台。
README (SKILL.md)

DingTalk Channel Setup

钉钉企业内部机器人渠道快速对接指南。

When to Use

USE this skill when:

  • 用户说"对接钉钉"、"配置钉钉机器人"
  • 钉钉消息没有响应,需要排查
  • 需要安装钉钉插件
  • "DingTalk channel setup"

DON'T use when:

  • 飞书/Lark 配置 → use feishu skill
  • 企业微信 → use wecom skill
  • Telegram/Discord → use respective channel skills

Prerequisites

确保已准备:

  1. 钉钉开放平台企业内部应用(已创建)
  2. Client ID (AppKey)
  3. Client Secret (AppSecret)
  4. 可选:Robot Code、Corp ID、Agent ID

Installation

Step 1: Install Plugin

国内网络环境(推荐使用镜像):

$env:NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
openclaw plugins install @soimy/dingtalk

国际网络:

openclaw plugins install @soimy/dingtalk

如需代理:

$env:HTTP_PROXY="http://127.0.0.1:7897"
$env:HTTPS_PROXY="http://127.0.0.1:7897"
openclaw plugins install @soimy/dingtalk

Step 2: Enable Plugin

编辑 ~/.openclaw/openclaw.json,添加插件到白名单:

{
  "plugins": {
    "enabled": true,
    "allow": ["dingtalk"]
  }
}

如果已有其他插件,添加到数组中:

{
  "plugins": {
    "allow": ["telegram", "discord", "dingtalk"]
  }
}

Step 3: Configure Channel

方式一:交互式配置(推荐)

openclaw configure --section channels

按提示操作:

  1. 选择 "Add a new channel"
  2. 选择 "DingTalk (钉钉)"
  3. 输入 Client ID
  4. 输入 Client Secret
  5. 选择是否配置完整信息(推荐 Yes)
  6. 配置其他选项(DM/Group 策略等)
  7. 完成配置

方式二:手动编辑配置文件

编辑 ~/.openclaw/openclaw.json,添加 channel 配置:

{
  "channels": [
    {
      "id": "dingtalk",
      "plugin": "dingtalk",
      "enabled": true,
      "clientId": "your_client_id",
      "clientSecret": "your_client_secret",
      "dm": "open",
      "group": "open"
    }
  ]
}

完整配置示例:

{
  "id": "dingtalk",
  "plugin": "dingtalk",
  "enabled": true,
  "clientId": "ding3ti4ahg82dsfkwld",
  "clientSecret": "FrpMFcI30c0STvaJJWyMSZoyeb2Hkm9YqXY-6mJ0dGwdN8Xux7mgT_Xn7qnpvO-F",
  "robotCode": "your_robot_code",
  "corpId": "your_corp_id",
  "agentId": "your_agent_id",
  "aiCard": false,
  "dm": "open",
  "group": "open"
}

Step 4: Restart Gateway

openclaw gateway restart

Configuration Options

参数 必需 说明 默认值
clientId DingTalk App Key -
clientSecret DingTalk App Secret -
robotCode 机器人代码 -
corpId 企业 ID -
agentId 应用 Agent ID -
aiCard 启用 AI 互动卡片 false
dm 私聊策略:open / allowlist open
group 群聊策略:open / allowlist open

Verification

测试连接:

# 检查 Gateway 状态
openclaw gateway status

# 查看日志
openclaw logs gateway

# 列出插件
openclaw plugins list

在钉钉中给机器人发送消息,应该能收到回复。

Troubleshooting

插件安装卡住

如果安装停在 "Installing plugin dependencies...":

cd ~/.openclaw/extensions/dingtalk
rm -rf node_modules package-lock.json
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com npm install
openclaw gateway restart

机器人无响应

检查清单:

  1. Gateway 运行中

    openclaw gateway status
    
  2. 插件在白名单 检查 openclaw.json 中的 plugins.allow 包含 "dingtalk"

  3. 渠道已启用 检查 channels[].enabledtrue

  4. 凭证正确 在钉钉开放平台验证 Client ID/Secret

  5. 重启 Gateway

    openclaw gateway restart
    

网络问题(中国大陆)

# 设置 npm 镜像
$env:NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"

# 设置代理(如需要)
$env:HTTP_PROXY="http://127.0.0.1:7897"
$env:HTTPS_PROXY="http://127.0.0.1:7897"

常见错误

"Plugin not found"

  • 确认插件已安装:openclaw plugins list
  • 检查目录存在:~/.openclaw/extensions/dingtalk

"Connection failed"

  • 验证钉钉开放平台凭证
  • 检查网络连接
  • 查看日志:openclaw logs gateway

"Plugin not loaded"

  • 添加 dingtalkplugins.allow
  • 重启 Gateway

Automated Setup (Optional)

如果需要自动化批量部署,可以创建以下 PowerShell 脚本:

auto-setup.ps1:

# DingTalk Channel Auto Setup Script
# Usage: .\auto-setup.ps1 -ClientId "xxx" -ClientSecret "xxx"

param(
    [Parameter(Mandatory=$true)]
    [string]$ClientId,
    
    [Parameter(Mandatory=$true)]
    [string]$ClientSecret,
    
    [string]$RobotCode = "",
    [string]$CorpId = "",
    [string]$AgentId = "",
    [string]$ProxyUrl = "http://127.0.0.1:7897",
    [string]$NpmRegistry = "https://registry.npmmirror.com",
    [switch]$UseProxy = $false
)

Write-Host "=== DingTalk Channel Auto Setup ===" -ForegroundColor Cyan

# Set proxy if needed
if ($UseProxy) {
    $env:HTTP_PROXY = $ProxyUrl
    $env:HTTPS_PROXY = $ProxyUrl
}

# Set npm registry
$env:NPM_CONFIG_REGISTRY = $NpmRegistry

# Install plugin
Write-Host "Installing plugin..." -ForegroundColor Yellow
openclaw plugins install @soimy/dingtalk

# Update openclaw.json
Write-Host "Updating configuration..." -ForegroundColor Yellow
$configPath = "$env:USERPROFILE\.openclaw\openclaw.json"
$config = Get-Content $configPath -Raw | ConvertFrom-Json

# Add plugin to allowlist
if (-not $config.plugins) {
    $config | Add-Member -MemberType NoteProperty -Name "plugins" -Value @{
        enabled = $true
        allow = @("dingtalk")
    }
} else {
    if (-not $config.plugins.allow) {
        $config.plugins | Add-Member -MemberType NoteProperty -Name "allow" -Value @("dingtalk")
    } elseif ($config.plugins.allow -notcontains "dingtalk") {
        $config.plugins.allow += "dingtalk"
    }
}

# Add channel configuration
if (-not $config.channels) {
    $config | Add-Member -MemberType NoteProperty -Name "channels" -Value @()
}

$dingtalkConfig = @{
    id = "dingtalk"
    plugin = "dingtalk"
    enabled = $true
    clientId = $ClientId
    clientSecret = $ClientSecret
    dm = "open"
    group = "open"
}

if ($RobotCode) { $dingtalkConfig.robotCode = $RobotCode }
if ($CorpId) { $dingtalkConfig.corpId = $CorpId }
if ($AgentId) { $dingtalkConfig.agentId = $AgentId }

$config.channels = @($config.channels | Where-Object { $_.id -ne "dingtalk" })
$config.channels += $dingtalkConfig

$config | ConvertTo-Json -Depth 10 | Set-Content $configPath

# Restart Gateway
Write-Host "Restarting Gateway..." -ForegroundColor Yellow
openclaw gateway restart

Write-Host "Setup Complete!" -ForegroundColor Green

使用方法

# 基本用法
.\auto-setup.ps1 -ClientId "your_id" -ClientSecret "your_secret"

# 使用代理
.\auto-setup.ps1 -ClientId "your_id" -ClientSecret "your_secret" -UseProxy

# 完整配置
.\auto-setup.ps1 `
    -ClientId "your_id" `
    -ClientSecret "your_secret" `
    -RobotCode "your_code" `
    -CorpId "your_corp" `
    -AgentId "your_agent" `
    -UseProxy

Files & Locations

  • 配置文件: ~/.openclaw/openclaw.json
  • 插件目录: ~/.openclaw/extensions/dingtalk
  • 日志: openclaw logs gateway

References

Notes

  • 使用 Stream 模式(无需公网 IP)
  • 支持私聊和群聊
  • AI 互动卡片可选
  • 仅支持企业内部应用
Usage Guidance
This guide is coherent for setting up a DingTalk channel. Before proceeding: (1) verify you trust the npm package @soimy/dingtalk and its upstream repository (review code or repository reputation) because installing the plugin will execute third-party code; (2) back up ~/.openclaw/openclaw.json before automated scripts modify it; (3) treat Client ID/Client Secret as sensitive—do not share them or paste them into public locations; (4) prefer official registries or verify the mirror you use (npmmirror) and any proxy settings to avoid supply-chain/Man-in-the-Middle risks. If you cannot verify the plugin source, consider inspecting the plugin package contents after installation before enabling it.
Capability Analysis
Type: OpenClaw Skill Name: dingtalk-setup Version: 1.0.0 The skill provides standard instructions and a helper PowerShell script for configuring a DingTalk channel integration. It involves installing a plugin (@soimy/dingtalk), modifying the local configuration file (~/.openclaw/openclaw.json), and restarting the gateway service. All actions, including the use of the npmmirror.com registry for Chinese network environments, are consistent with the stated purpose and lack any indicators of malicious intent or data exfiltration.
Capability Assessment
Purpose & Capability
Name/description (DingTalk channel setup) match the instructions: installing a dingtalk OpenClaw plugin, adding it to ~/.openclaw/openclaw.json, and supplying DingTalk AppKey/AppSecret. No unrelated credentials, binaries, or unexpected capabilities are requested.
Instruction Scope
SKILL.md instructs only installation of the plugin, editing OpenClaw config, restarting the gateway, and basic troubleshooting (checking gateway status, logs, plugin directory). Those file paths and commands (openclaw, ~/.openclaw/openclaw.json, extension directory) are directly relevant to the stated task and are not overly broad.
Install Mechanism
The skill is instruction-only (no code), but it instructs using `openclaw plugins install @soimy/dingtalk` which will fetch and install an npm-scoped plugin. Installing a third-party plugin runs code obtained from the npm registry (or a mirror). This is expected for a plugin-based setup but is a downstream trust/risk consideration; the SKILL.md itself does not use obscure download URLs.
Credentials
The only sensitive inputs are the expected DingTalk credentials (Client ID/AppKey and Client Secret) used to configure the channel. No unrelated secrets or system credentials are requested. The guide suggests setting HTTP(S)_PROXY and NPM_CONFIG_REGISTRY for installation, which is normal for users behind proxies.
Persistence & Privilege
The skill does not request elevated or persistent platform privileges. always is false and the instructions only modify the skill's own OpenClaw config (~/.openclaw/openclaw.json) and extension directory, which is appropriate for adding a channel plugin.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dingtalk-setup
  3. After installation, invoke the skill by name or use /dingtalk-setup
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
钉钉企业内部机器人渠道快速对接指南。支持交互式配置、自动化脚本和手动设置。包含故障排查指南和国内网络优化。支持 Stream 模式(无需公网 IP)。
Metadata
Slug dingtalk-setup
Version 1.0.0
License MIT-0
All-time Installs 15
Active Installs 13
Total Versions 1
Frequently Asked Questions

What is DingTalk Channel Setup?

钉钉企业内部机器人渠道快速对接。Use when: 用户需要对接钉钉渠道、配置钉钉 Stream 模式、排查钉钉消息问题。NOT for: 飞书/Lark、企业微信等其他平台。 It is an AI Agent Skill for Claude Code / OpenClaw, with 1346 downloads so far.

How do I install DingTalk Channel Setup?

Run "/install dingtalk-setup" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is DingTalk Channel Setup free?

Yes, DingTalk Channel Setup is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does DingTalk Channel Setup support?

DingTalk Channel Setup is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created DingTalk Channel Setup?

It is built and maintained by shaoyunhao0107 (@shaoyunhao0107); the current version is v1.0.0.

💬 Comments