返回顶部
d

dingtalk-workspace钉钉工作台

Interact with DingTalk enterprise workspace using the `dws` CLI. Use for: (1) searching contacts and departments, (2) sending chat messages, (3) managing calendar events and meeting rooms, (4) creating and managing todos, (5) approval workflows, (6) attendance records, (7) AITable CRUD operations, (8) report management. Requires dws CLI installed and authenticated via OAuth.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
92
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

dingtalk-workspace

DingTalk 工作台技能

使用 dws 命令行工具与钉钉企业工作台进行交互。本技能涵盖全部 12 个产品:通讯录、聊天、机器人、日历、待办、OA(审批)、考勤、DING、日志、多维表、工作台和开发文档。

⚠️ 安全与注意事项

安装前请阅读:

  1. 1. 需要凭证:本技能需要来自钉钉开放平台应用的 OAuth 凭证(DWSCLIENTID、DWSCLIENTSECRET)。可能需要企业管理员审批。
  1. 2. 安全安装:dws 命令行安装程序从 GitHub 获取。运行前请检查安装脚本
- 安装程序:https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/blob/main/scripts/install.sh - 发布版本:https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/releases
  1. 3. 自主执行风险:本技能可执行破坏性操作(审批工作流、发送消息、删除记录)。始终先使用 --dry-run,除非您信任该代理,否则限制自主调用。
  1. 4. 最小权限原则:使用具有最小权限的范围化 OAuth 凭证。先在沙箱企业中测试。

前提条件

安装

选项 1:从发布版本安装(推荐)

从 https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli/releases 下载预构建二进制文件

选项 2:从源码构建(更安全)

bash
git clone https://github.com/DingTalk-Real-AI/dingtalk-workspace-cli.git
cd dingtalk-workspace-cli
go build -o dws ./cmd
cp dws ~/.local/bin/

选项 3:安装脚本(请先检查!)

bash

macOS / Linux - 运行前请检查脚本


curl -fsSL https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/main/scripts/install.sh | sh

Windows (PowerShell) - 运行前请检查脚本

irm https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/main/scripts/install.ps1 | iex

身份认证

bash

首次登录(凭证保存到系统钥匙串)


dws auth login --client-id <您的应用密钥> --client-secret <您的应用密钥>

或通过环境变量

export DWSCLIENTID=<您的应用密钥> export DWSCLIENTSECRET=<您的应用密钥> dws auth login

安全执行指南

针对代理

  • - --dry-run始终先使用进行变更操作以预览 API 调用
  • --yes:跳过确认提示(仅在通过 --dry-run 验证后使用)
  • --jq:提取特定字段以减少令牌消耗
  • --fields:仅返回所需字段

推荐工作流程

bash

1. 预览操作


dws todo task create --title 测试 --executors user123 --dry-run

2. 验证输出是否正确

3. 执行(仅在预览正确时)

dws todo task create --title 测试 --executors user123 --yes

自动纠错

dws 自动纠正常见的 AI 错误:

  • - --baseId → --base-id(驼峰式转短横线式)
  • --timeout30 → --timeout 30(粘性参数拆分)
  • --tabel-id → --table-id(模糊匹配)
  • yes → true,2024/03/29 → 2024-03-29(值规范化)

发现与自省

在发起调用前,发现可用能力:

bash

列出所有产品和工具数量


dws schema --jq .products[] | {id, tool_count: (.tools | length)}

检查特定工具的参数模式

dws schema aitable.query_records --jq .tool.parameters

查看必填字段

dws schema aitable.query_records --jq .tool.required

列出所有产品 ID

dws schema --jq .products[].id

按产品快速参考

通讯录

bash

按关键词搜索用户


dws contact user search --keyword 工程

获取当前用户资料

dws contact user get-self --jq .result[0].orgEmployeeModel | {name: .orgUserName, dept: .depts[0].deptName}

按名称搜索部门

dws contact dept search --keyword 工程

列出部门成员

dws contact dept members --dept-id <部门ID>

聊天

bash

以机器人身份发送消息


dws chat message send-by-bot --robot-code <机器人编码> --group <群组ID> --title 周报 --text @report.md

列出群组

dws chat group list

获取群组信息

dws chat group get --group-id <群组ID>

日历

bash

列出日历事件


dws calendar event list

创建事件

dws calendar event create --title 团队会议 --start 2024-03-29T14:00:00Z --end 2024-03-29T15:00:00Z

查找空闲时段

dws calendar participant busy --user-ids <用户ID1>,<用户ID2> --start 2024-03-29 --end 2024-03-30

搜索会议室

dws calendar room search --keyword 会议室

待办

bash

创建待办


dws todo task create --title 审查 PR --executors <您的用户ID> --yes

列出待办

dws todo task list

标记为完成

dws todo task done --task-id <任务ID>

审批(OA)

bash

列出待审批事项


dws oa approval list --status pending

审批实例

dws oa approval approve --instance-id <实例ID> --comment 已批准

拒绝实例

dws oa approval reject --instance-id <实例ID> --comment 需要修改

考勤

bash

查看我的考勤记录


dws attendance record list --user-id <您的用户ID>

查看团队排班表

dws attendance shift list --dept-id <部门ID>

日志

bash

查看今日收到的日志


dws report list --type received --start-date 2024-03-29 --end-date 2024-03-29

创建日志

dws report create --template-id <模板ID> --content @report.md

多维表

bash

查询记录


dws aitable record query --base-id ID> --table-id ID> --limit 10

创建记录

dws aitable record create --base-id ID> --table-id ID> --fields {name: 任务1, status: open}

列出多维表

dws aitable base list

列出多维表中的表格

dws aitable table list --base-id

输出控制

jq 过滤

bash

提取特定字段


dws contact user search --keyword 工程 --jq .result[] | {name: .orgUserName, userId: .userId}

统计结果数量

dws todo task list --jq .result | length

字段选择

bash

仅返回特定字段


dws aitable record query --base-id ID> --table-id ID> --fields invocation,response

文件输入

bash

从文件读取


dws chat message send-by-bot --robot-code <机器人编码> --group <群组ID> --text @message.md

从标准输入管道

cat message.md | dws chat message send-by-bot --robot-code <机器人编码> --group <群组ID>

常见工作流程

参见 scripts/ 中的捆绑脚本以进行批量操作:

脚本描述
calendarschedulemeeting.py创建事件 + 添加参与者 + 预订会议室
calendarfreeslot_finder.py
查找多人共同空闲时段 |
| todobatchcreate.py | 从 JSON 批量创建待办 |
| contactdeptmembers.py | 搜索部门并列出所有成员 |
| reportinboxtoday.py | 查看今日收到的日志

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 dingtalk-workspace-1775891417 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 dingtalk-workspace-1775891417 技能

通过命令行安装

skillhub install dingtalk-workspace-1775891417

下载

⬇ 下载 dingtalk-workspace v1.0.1(免费)

文件大小: 26.6 KB | 发布时间: 2026-4-12 09:44

v1.0.1 最新 2026-4-12 09:44
- Added a dedicated security and safety section at the top, highlighting credential handling, installation review, and safe usage with destructive actions.
- Expanded installation instructions with multiple options (pre-built binaries, source build, install script) and emphasized reviewing installer scripts before use.
- Clarified OAuth credential requirements and placement for authentication.
- Strengthened safe execution instructions for agents, with explicit --dry-run use and a recommended step-by-step workflow.
- No API or functional changes to commands; documentation and guidance improved for safer, more secure ons.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部