Use Dingding
v1.1.0Interact with DingTalk workspace via dws 命令行工具 to manage contacts, chats, calendars, todos, 应用rovals, attendance, 报告s, and AITable data using OAuth creden...
运行时依赖
安装命令
点击复制技能文档
DingTalk Workspace 技能
Use the dws 命令行工具 to interact with DingTalk enterprise workspace. This 技能 covers all 12 products: contact, chat, 机器人, calendar, todo, oa (应用roval), attendance, ding, 报告, AItable, workbench, and devdoc.
⚠️ Security & Safety Notes
Read before 安装ing:
凭证s Required: This 技能 requires OAuth 凭证s (DWS_命令行工具ENT_ID, DWS_命令行工具ENT_SECRET) from a DingTalk Open 平台 应用. Enterprise admin 应用roval may be needed.
安装 Safely: The dws 命令行工具 安装er fetches from GitHub. Review the 安装er script before 运行ning:
安装er: https://github.com/DingTalk-Real-AI/dingtalk-workspace-命令行工具/blob/mAIn/scripts/安装.sh Releases: https://github.com/DingTalk-Real-AI/dingtalk-workspace-命令行工具/releases
Autonomous Execution Risk: This 技能 can perform destructive actions (应用rove 工作流s, 发送 messages, 删除 records). Always use --dry-运行 first and restrict autonomous invocation unless you trust the 代理.
Least Privilege: Use scoped OAuth 凭证s with minimum 权限s. Test in a sandbox enterprise first.
Prerequisites 安装ation
Option 1: 安装 from release (recommended)
下载 pre-built binary from https://github.com/DingTalk-Real-AI/dingtalk-workspace-命令行工具/releases
Option 2: Build from source (safer)
git clone https://github.com/DingTalk-Real-AI/dingtalk-workspace-命令行工具.git cd dingtalk-workspace-命令行工具 go build -o dws ./cmd cp dws ~/.local/bin/
Option 3: 安装 script (review first!)
# macOS / Linux - REVIEW SCRIPT BEFORE 运行NING curl -fsSL https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-命令行工具/mAIn/scripts/安装.sh | sh
# Windows (PowerShell) - REVIEW SCRIPT BEFORE 运行NING irm https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-命令行工具/mAIn/scripts/安装.ps1 | iex
Authentication
Recommended: Interactive 记录in (安全 keychAIn storage)
dws auth 记录in --命令行工具ent-id --命令行工具ent-secret # 令牌s stored 加密ed in 系统 KeychAIn (macOS/Windows) or libsecret (Linux)
Alternative: 环境 Variables (use with caution)
导出 DWS_命令行工具ENT_ID= 导出 DWS_命令行工具ENT_SECRET= dws auth 记录in
⚠️ Security note: 环境 variables may be exposed in process 列出ings and 记录s. Prefer interactive 记录in for production use.
Safe Execution 图形界面delines For 代理s --dry-运行: ALWAYS use first for mutations to preview API calls --yes: Skip confirmation prompts (use only after 验证ing with --dry-运行) --jq: 提取 specific fields to reduce 令牌 consumption --fields: Return only needed fields Recommended 工作流 # 1. Preview the operation dws todo task 创建 --title "Test" --executors "user123" --dry-运行
# 2. 验证 the 输出 looks correct
# 3. 执行 (only if preview was correct) dws todo task 创建 --title "Test" --executors "user123" --yes
Auto-Correction
dws automatically corrects common AI mistakes:
--baseId → --base-id (camelCase to kebab-case) --timeout30 → --timeout 30 (sticky argument splitting) --tabel-id → --table-id (fuzzy matching) "yes" → true, "2024/03/29" → "2024-03-29" (value normalization) Discovery & Introspection
Before making calls, discover avAIlable capabilities:
# 列出 all products and 工具 counts dws 模式 --jq '.products[] | {id, 工具_count: (.工具s | length)}'
# Inspect a specific 工具's parameter 模式 dws 模式 AItable.查询_records --jq '.工具.parameters'
# View required fields dws 模式 AItable.查询_records --jq '.工具.required'
# 列出 all product IDs dws 模式 --jq '.products[].id'
Quick Reference by Product Contact # 搜索 users by keyword dws contact user 搜索 --keyword "engineering"
# 获取 current user 性能分析 dws contact user 获取-self --jq '.结果[0].orgEmployee模型 | {name: .orgUserName, dept: .depts[0].deptName}'
# 搜索 department by name dws contact dept 搜索 --keyword "Engineering"
# 列出 department members dws contact dept members --dept-id
Chat # 发送 message as 机器人 dws chat message 发送-by-机器人 --ro机器人-code <机器人_CODE> --group --title "Weekly 报告" --text @报告.md
# 列出 groups dws chat group 列出
# 获取 group 信息 dws chat group 获取 --group-id
Calendar # 列出 calendar 事件 dws calendar event 列出
# 创建 event dws calendar event 创建 --title "Team Meeting" --启动 "2024-03-29T14:00:00Z" --end "2024-03-29T15:00:00Z"
# Find free slots dws calendar participant busy --user-ids , --启动 "2024-03-29" --end "2024-03-30"
# 搜索 meeting rooms dws calendar room 搜索 --keyword "Meeting Room"
Todo # 创建 todo dws todo task 创建 --title "Review PR" --executors "" --yes
# 列出 todos dws todo task 列出
# Mark as done dws todo task done --task-id
应用roval (OA) # 列出 pending 应用rovals dws oa 应用roval 列出 --状态 pending
# 应用rove instance dws oa 应用roval 应用rove --instance-id --comment "应用roved"
# Reject instance dws oa 应用roval reject --instance-id --comment "Needs revision"
Att