Introduction¶
The philosophy of DSH (DeepSeek Harness) is “everything is a plugin,” and plugins are the primary way to extend agent capabilities. For tasks requiring the agent to create, read, query, and edit .docx, .xlsx, and .pptx files within DSH, dsh-office-tool provides a ready-made toolchain.
It is a DeepSeek Harness (DSH / dsh) plugin. The GitHub repository is rong-coder/dsh-office-tool, and it is licensed under MIT. It utilizes the OfficeCLI binary to drive Office document capabilities and provides document previews in the DSH web sidebar; the preview section depends on dsh-better-sidebar.
What is it¶
dsh-office-tool provides the full Office document capabilities for DSH agents to create, read, query, and edit .docx, .xlsx, and .pptx files.
Its core features include:
- Uses the OfficeCLI binary to execute Office document operations.
- Exposes a set of structured tools to the model.
- Provides document preview in the DSH web sidebar.
- Does not require Microsoft Office; it relies on the OfficeCLI built-in high-fidelity HTML engine to render previews.
- The tools can be enabled in profiles without a Web UI, as the preview route depends on the Web server.
Core Features¶
Office Document Operations¶
The plugin provides 9 model tools covering creation, reading, querying, modification, adding, deletion, viewing, batch operations, and raw command passthrough:
office_create(file, type?, force?)
office_get(file, path?, depth?)
office_query(file, selector, limit?)
office_set(file, path, props, find?, replace?)
office_add(file, parent, type, props?, after?/before?/index?/from?)
office_remove(file, path, shift?)
office_view(file, mode, page?, cols?, maxLines?)
office_batch(file, commands[], bestEffort?)
office_cli(argv)
The purpose of these tools is as follows:
office_create: Creates a blank document.office_get: Reads elements and child elements.office_query: Queries based on a selector.office_set: Modifies element properties.office_add: Adds or clones elements.office_remove: Deletes elements.office_view: Views modes such astext,outline,annotated,stats,issues,html, andscreenshot.office_batch: Executes batch operations.office_cli: Passthrough for OfficeCLI raw commands, for example:
merge
dump
import
validate
raw
raw-set
move
swap
refresh
help
load_skill
Structured Responses¶
The tools use structured --json responses. In case of failure, the OfficeCLI error code is exposed to facilitate processing by the model or caller.
Web Sidebar Preview¶
The preview feature relies on dsh-better-sidebar installed in the same profile.
Once enabled, the following can be provided in the DSH web sidebar:
docx/xlsx/pptxfile viewers.- An “Office Preview” tab running
officecli watch.
Real-time preview only refreshes when OfficeCLI modifies the document; files modified by other tools are not automatically pushed.
Available without Web UI¶
dsh-office-tool can enable tools in profiles without a Web UI.
The preview route is only registered when the host has ctx.webServer; in headless mode, only the tools are available.
Installation and Activation¶
First, confirm the installation prerequisites:
dshis installed and a usable profile is configured.- Enabling preview requires a web profile.
- The OfficeCLI binary is required.
$DSH_OFFICECLIcan override the defaultofficecli.- The preview feature requires
dsh-better-sidebarto be installed in the same profile.
First install the preview dependency, then install this plugin:
dsh plugin --profile web add dsh-better-sidebar
dsh plugin --profile web add dsh-office-tool
If installing from a local repository, clone and install dependencies first:
git clone https://github.com/rong-coder/dsh-office-tool.git
cd dsh-office-tool && pnpm install
dsh plugin --profile web add ./dsh-office-tool
Configuration¶
The plugin supports configuring these items via the profile’s cordis.patch.yml:
command
timeoutMs
maxOutputBytes
preview.allowOutsideWorkspace
watch.enabled
watch.idleSeconds
Configuration example:
- id: office-tool
config:
command: 'C:\path\to\officecli.exe'
timeoutMs: 60000
maxOutputBytes: 16777216
- id: office-tool-preview
config:
preview:
allowOutsideWorkspace: false
watch:
enabled: true
idleSeconds: 300
command can be the binary name or an absolute path; $DSH_OFFICECLI will override the default officecli.
Typical Usage¶
Create a blank document:
office_create(file, type?, force?)
Read elements and child elements:
office_get(file, path?, depth?)
Query based on a selector:
office_query(file, selector, limit?)
Modify element properties:
office_set(file, path, props, find?, replace?)
Add or clone elements:
office_add(file, parent, type, props?, after?/before?/index?/from?)
Delete elements:
office_remove(file, path, shift?)
View document content:
office_view(file, mode, page?, cols?, maxLines?)
Execute batch operations:
office_batch(file, commands[], bestEffort?)
Passthrough OfficeCLI raw commands:
office_cli(argv)
Applicable Scenarios and Notes¶
dsh-office-tool is suitable for these scenarios:
- Wanting the DSH agent to handle
.docx,.xlsx,.pptxfiles directly. - Wanting to preview Office documents in the DSH web sidebar.
- Wanting to call Office document tools in a profile without a Web UI.
- Wanting to use OfficeCLI raw passthrough commands to handle more complex document operations.
Notes to consider before installation:
- The plugin runs with the permissions of the current DSH process; check the source code and license before installing.
- Relative file paths in tools are resolved based on the host’s cwd when
dshis started. - The
screenshotmode ofoffice_viewrequires a headless browser installed on the host. - HTML containing formulas will load KaTeX from a CDN; formulas will fall back to monospace text without a network.
dsh-better-sidebaris marked as optional in thepeerDependenciesMetaofpackage.json.- The preview route is only registered when the host has
ctx.webServer; in headless mode, only the tools are available.
Conclusion¶
The value of dsh-office-tool lies in encapsulating Office document capabilities into tools that the DSH agent can call directly, while retaining the web sidebar preview entry point. The community directory is an independent site with no official affiliation to DeepSeek or Fangfang; if you need to search within the directory, you can search by the plugin name dsh-office-tool. The verifiable repository address is:
https://github.com/rong-coder/dsh-office-tool