cnkids/dsh-office-toolkit

DSH 宿主插件:给 AI 智能体增加读写 Word/Excel 的工具(docx/xlsx/xls/doc/rtf/odt,纯 JS 跨平台)| DSH host plugin: Word/Excel read & write tools for AI agents

Project Overview项目介绍

dsh-office-toolkit is a native plugin built exclusively for DeepSeek Harness (DSH) that enables DSH agents to read and write a dozen of common Office file formats natively. It is written purely in JavaScript, so users do not need to have Microsoft Office or LibreOffice already installed on their system to use core features. To install the plugin, users can run the simple command dsh plugin --profile web add dsh-office-toolkit in their terminal, and alternative installation methods like GitHub direct link, offline install, and local source install are also available for different use cases. After installation completes, eight dedicated office processing tools are automatically registered for DSH agents to call, each tailored for a specific office task.

This plugin is designed for DSH users who need agents to automate repetitive common office tasks, including generating formal reports, organizing financial ledgers, filling batch contract templates, and analyzing large tabular data. Instead of requiring users to manually move files or convert formats between different tools, the agent can handle the entire process end-to-end directly within DSH. It eliminates common errors that happen when generic file reading commands try to process binary Office files, which often causes agents to get stuck mid-task. It also supports in-file querying for large tables, so agents only return concise calculation results instead of dumping entire large datasets.

The plugin requires Node.js version 20 or newer, and works across all major desktop platforms including macOS, Windows, and Linux. It is released under the permissive open source MIT license, so it is free to use, modify, and distribute for both personal and commercial purposes. After installing the plugin, users must restart their DSH web instance or reload the desktop client and start a new session for the tools to load correctly. PDF output and high-fidelity conversion of older legacy formats require a local installation of LibreOffice or Microsoft Word, as pure JavaScript cannot handle these conversions natively.

dsh-office-toolkit 是专为 DeepSeek Harness(DSH)开发的原生插件,核心能力是让 DSH 智能体直接读写多种常用 Office 文件格式,包括 docx、xlsx、xls、csv 等,无需用户手动安装 Office 或 LibreOffice 就能运行。它通过 DSH 插件管理器直接安装,安装完成后会自动注册 8 个办公处理工具供智能体调用。

该插件适合需要让智能体批量处理办公文档的 DSH 用户,可满足报告生成、台账整理、合同模板套打、表格数据统计分析等常见办公需求。智能体可以直接读取文档内容、在表格内完成筛选分组、多表连接和透视计算,不用手动搬运文件,也不会因通用读命令无法处理二进制文件而卡住。

该插件要求 Node.js 版本不低于 20,支持 macOS、Windows、Linux 全平台,采用 MIT 许可开源免费使用。PDF 输出和旧格式高保真转换依赖本机已安装的 LibreOffice 或 Microsoft Word,安装后需要重启 DSH 或新建会话才能正常加载工具。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-office-toolkit

把 cnkids/dsh-office-toolkit 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-office-toolkit

让 DSH 智能体自己读写 Word / Excel
纯 JavaScript,不装 Office 也能跑。

Latest release Total downloads Node.js 20 or newer Supported platforms: macOS, Windows and Linux MIT License

安装 · 快速上手 · 工具 · 文档 · 常见问题 · 贡献 · Releases


装上这个宿主插件,智能体就能直接读报告、写台账、改表格、套合同模板、转换旧格式 —— 不用再手动搬文件,也不会因为通用 read 读不了二进制而卡住。

特性

  • 纯 JS,开箱可用 —— 不装 Office / LibreOffice 就能读写 .docx .xlsx .xls .csv,也能读 .pdf 文本(本机有 pdftotext / macOS PDFKit 就用它,否则用随包携带的 pdfjs),Windows 上同样零依赖。
  • 读写改一条龙 —— 新建文档、新建工作簿、编辑已有工作簿(样式 / 合并 / 冻结 / 筛选 / 图片 / 图表)、{{变量}} 模板套打、跨格式转换。
  • 8 个工具自动注册 —— 见工具;描述里前置了文件类型关键字,智能体一次就能选对。
  • 大表直接算,不用先搬数据 —— office_query 在文件内做筛选 / 分组 / 求和 / 计数 / 去重 / 排序,几万行也只返回结论;不给条件时返回表结构画像。跨文件的多表连接(join:inner/left/right/full,列名相同或左右对应)与透视表(pivot:行 × 列 × 指标,可带合计)也在这里做,不用写脚本。
  • 排版可指定 —— style 参数设整篇字体 / 字号 / 行距 / 首行缩进 / 对齐(公文体例:仿宋_GB2312 三号、行距固定值 28.8 磅、首行缩进 2 字符),标题用 style.headings,表格用 style.table(三线表 / 表头底纹 / 按内容自动分配列宽);html 内联样式也认 font-family(含中文 eastAsia)/ line-height / text-indent / margin,<body>、<div> 上的样式会被继承。
  • 改之前能先看、改之后能留底 —— office_edit_docx 传 dryRun: true 只报改动不写盘,传 outputPath 另存为新文件而原文件不变。
  • 改已有文档能分段、分角色 —— set_style 的 scope 支持 body(正文,不含标题)/ headings / table / all,可叠加段落区间;例如「只把正文改成单倍行距」一句就够。表格另有 set_table(框线 / 底纹 / 列宽 / 单元格内边距 / 垂直对齐 / 行高 / 表头跨页重复 / 禁止断行)、增删行列、合并与取消合并,以及 delete_table 整表删除(含删空后的 0 行残留)。
  • 多级自动编号 —— set_numbering 把标题按样式挂上 Word 多级编号(1. / 1.1 / 1.1.1),正文列表挂到当前标题层级之下;支持 exclude(某些标题不参与)与 startFrom(从哪级起算、起始数字);幂等,重复调用原地替换不堆积定义。编号由 Word 维护,改标题会自动重排,不用手写「一、」「1.1」。
  • 页眉页脚、页码、目录 —— header / footer(页码是 Word 域,如「第 X 页 共 Y 页」或公文式「— 1 —」)、toc 插入目录域;插件已设 updateFields,Word 打开即按当前排版刷新。
  • 图片与编号都落到实处 —— <img> 指向本地文件或 data: URL 就嵌成真图片(PNG / JPEG / GIF / BMP,按魔数读尺寸、按正文宽等比缩放;不联网,远程地址与超 8 MB 直接报错);读 Word 时把自动编号展开成文字(一、 / (一) / 1.1),行文规则比对看得到层级。
  • 公式与日期是真的 —— = 开头写公式,date:2026-09-09 写日期,日期回读不受时区影响。
  • 排版格式可读 —— .docx 传 withFormatting: true 即返回每段的字体 / 字号 / 行距 / 首行缩进 / 对齐与页面页边距(含 basedOn 继承链、隐式默认样式与主题字体),并给出格式分布和偏离主流的段落,用于比对行文规则。见用法与参数。
  • 默认安全 —— 写入经 DSH 沙箱围栏(含 realpath 校验),文本来源中和公式注入,解析全走线性扫描(无 ReDoS),不联网、不常驻后台、依赖树无安装脚本。见安全说明。
  • npm audit 0 条 —— 依赖取舍见设计说明。
  • 可选的更高保真 —— 装了 LibreOffice / Word / macOS textutil 时,旧格式转换自动升级。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-win-quick-launcher 下一个 Next dsh-knj-workflow →