Introduction

This is a DeepSeek Harness (DSH) client plugin maintained by violetdream. Its core value is enabling Agents to create and edit Office documents (docx / xlsx / pptx) through natural language, with results displayed in real time in the DSH Web sidebar.

OfficeCLI is a command-line tool without a layout engine. Directly letting the model call the low-level add shape and fill in coordinates almost inevitably results in layout breakage. This plugin therefore includes a built-in PPT design layer that calculates coordinates, font sizes, and colors, while the model only fills in content. For docx and xlsx, it provides low-level tools close to the original primitives.

Installation and Configuration

1. Install Dependencies and Build

Enter the plugin directory, install dependencies, and build:

cd D:\workspace\deepseek-harness\dsh-officecli
pnpm install --ignore-workspace
pnpm build

2. Attach to DSH Profile

Run the installation command from the root directory of the DSH repository:

node --import tsx/esm apps/cli/src/bin.ts plugin --profile web add "D:\workspace\deepseek-harness\dsh-officecli"

3. Configure the Plugin

Edit $DSH_HOME/profiles/web/cordis.patch.yml (Note: do not modify cordis.yml) and insert the following configuration:

- insert:
    - id: dsh-officecli
      name: dsh-officecli
      config:
        officecliPath: officecli
        workspaceDir: ""
        watchPort: 0
        commandTimeoutMs: 30000
        batchTimeoutMs: 60000

4. Restart DSH

After installation, restart the DSH process to apply the configuration.

Core Features

Tools and Design Layer

The plugin provides 16 AI tools (12 low-level primitive tools + 4 high-level PPT tools). For PPT, it includes a built-in design layer:
- Canvas: 960×540pt
- Grid: 12 columns
- Baseline: 8pt
- Themes and Templates: 8 themes, 19 layouts, 12 professional templates
- Style Protocol: deck.style injects metadata, default transitions, and page number formatting

Native Elements and Security

In addition to shapes, the plugin natively integrates OfficeCLI’s chart (18 chart types), table, picture, diagram (Mermaid), connector, animation, and notes. At the execution level, it uses spawn argument arrays, avoids shell concatenation, and validates file names against a whitelist to ensure security.

Real-time Preview and Integration

  • Sidebar Preview: Click “📄 Office Preview” at the bottom of the sidebar; the iframe loads the OfficeCLI watch page.
  • Follow Mode: When the Agent edits the document, list items highlight and flash, and the preview refreshes automatically without manual reloading.
  • Visual Consistency: The preview panel uses DSH theme variables and dsh-client-ui-primitives icons, with support for light/dark theme adaptation.
  • Session Isolation: Each conversation session has an isolated workspace, with files written to exec.agent.session.cwd.

Usage Examples

  1. Click the “📄 Office Preview” button at the bottom of the DSH Web UI sidebar.
  2. After clicking a file, the lower-half iframe loads the OfficeCLI watch page.
  3. After the Agent edits the document, list items highlight and flash, and the preview refreshes automatically.

Low-level Primitives (docx / xlsx)

创建一个 report.docx,写两段自我介绍。
在 report.docx 的第二段后插入一个表格,包含姓名、年龄、职业三列。
读取 report.docx 的全部内容。
列出当前会话中的所有 Office 文档。
请先用 office_design_guide 查看设计规范,然后用 office_deck_create 生成一份 7 页的
中文 PPT,主题为《2026 年 AI 办公趋势洞察》,文件名 ai趋势洞察.pptx,主题用 tech-cyan。
生成后用 office_screenshot 逐页截图自查,如发现文字溢出或对比度问题就用 office_batch
修正,最多 3 轮。

DeckSpec Example

It provides a JSON-format configuration, including fields such as theme and slides, so the model only needs to focus on content filling.

Notes

  • Prerequisites: OfficeCLI must be installed and either available in PATH or configured with an absolute path; Node.js v18+ is required.
  • Configuration File: Configuration must be written to cordis.patch.yml; do not modify cordis.yml.
  • Build Requirement: After modifying the src/ directory, rerun pnpm build and restart DSH; the runtime loads the compiled artifacts.
  • Optional Feature: In profiles without HTTP, the tools work as usual, except that there is no sidebar preview.
  • Project Directory: https://www.skillhub.cn/plugins/violetdream/dsh-officecli
  • Source Code: https://github.com/violetdream/dsh-officecli