Skip to main content

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|status
  • workspace list|info
  • node list|info|resolve-url
  • doc create|read|overwrite|delete
  • workbook sheets|info|read
  • member 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dingtalk_cli-1.0.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dingtalk_cli-1.0.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

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

Hashes for dingtalk_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8bbc61abeaa7dd5818b7f95382e4b756dec0aa2e988a2224d81ce44636440e32
MD5 5a5e6ea4d623e9df8f8095b838b73138
BLAKE2b-256 192556d5d9382a35fc857e5c98c6343ff3bdc3613d095d5e19e148ea767627e9

See more details on using hashes here.

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

Hashes for dingtalk_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c885cfed24a03d3c6412d4366a2c10cf94ea1fac174112553d9f398f684ebe9
MD5 d874761d3d38c7eca12aa75f1a970be7
BLAKE2b-256 03c76d419a060dbd252a01d392e6b3ba910364535af54d7a77306bdd6d8cdc49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page