Agent-friendly CLI and built-in skill for DingTalk docs and wiki operations.
Project description
dingtalk-cli
dingtalk-cli 是一个面向 agent 的钉钉文档 CLI,覆盖知识库、节点、文档读写、.axls 表格读取和成员管理,并内置可发现的 SKILL.md。
安装
pip install dingtalk-cli
从源码开发安装:
pip install -e .
安装后可用命令:
dingtalk-cli --help
dingtalk-cli
配置
推荐直接通过命令写入本地配置:
dingtalk-cli auth setup \
--app-key <APP_KEY> \
--app-secret <APP_SECRET> \
--operator-union-id <UNION_ID>
如果只知道 userId,可以让 CLI 自动换取 unionId:
dingtalk-cli auth setup \
--app-key <APP_KEY> \
--app-secret <APP_SECRET> \
--operator-user-id <USER_ID>
配置文件位于 ~/.dingtalk-cli/,可通过 DINGTALK_CLI_CONFIG_DIR 覆盖。
主要命令
auth setup|set-operator|statusworkspace list|infonode list|info|resolve-urldoc create|read|overwrite|deleteworkbook sheets|info|readmember add|update|remove
所有命令支持 --json,便于 agent 解析。
示例
# 查看知识库
dingtalk-cli --json workspace list --all
# 通过 URL 读取文档正文
dingtalk-cli doc read --url "https://alidocs.dingtalk.com/i/nodes/xxx"
# 覆盖写入文档
dingtalk-cli doc overwrite --doc-key <DOC_KEY> --content-file /abs/path/content.md --yes
# 若已知 create 返回的 workspace_id + node_id,可直接删除
dingtalk-cli doc delete --workspace-id <WORKSPACE_ID> --node-id <NODE_ID> --yes
# 读取钉钉表格
dingtalk-cli workbook read --node-id <NODE_ID> --range A1:Z80
给 Agent 的约定
- 优先使用
--json - 写命令都需要显式
--yes doc read遇到.axls会返回结构化错误并指向workbook命令- REPL 启动横幅会展示内置
SKILL.md的绝对路径
对外分发
标准构建命令:
python3 -m build
python3 -m twine check dist/*
详细发布流程见 RELEASE.md。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dingtalk_cli-1.0.0.tar.gz.
File metadata
- Download URL: dingtalk_cli-1.0.0.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bbc61abeaa7dd5818b7f95382e4b756dec0aa2e988a2224d81ce44636440e32
|
|
| MD5 |
5a5e6ea4d623e9df8f8095b838b73138
|
|
| BLAKE2b-256 |
192556d5d9382a35fc857e5c98c6343ff3bdc3613d095d5e19e148ea767627e9
|
File details
Details for the file dingtalk_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dingtalk_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c885cfed24a03d3c6412d4366a2c10cf94ea1fac174112553d9f398f684ebe9
|
|
| MD5 |
d874761d3d38c7eca12aa75f1a970be7
|
|
| BLAKE2b-256 |
03c76d419a060dbd252a01d392e6b3ba910364535af54d7a77306bdd6d8cdc49
|