Blog · Tutorial
Write Your First DeepSeek Harness Plugin: Tool, Bundle, Publish
August 30, 2026 · dshbase · rewritten field note
Adapted and rewritten from a WeChat public-account post by GoCoding.
Source clue (WeChat via Sogou; not a verbatim reprint) — Adapted and rewritten from a WeChat public-account post by GoCoding.
Harness ships with plugins, but the interesting part is writing your own. This walkthrough — restructured from a community dev log — covers the full loop: register a tool, load it hot, package it, and publish it.
One tool, one module
A DSH plugin is a TypeScript module that exports apply(ctx, config). Capability registration happens through the ctx object. A minimal plugin that adds a greet tool does three things: declares inject: ['tools'] so the Cordis runtime waits for the tool registry, defines a config schema with defaults (via Schema.object, validated at load time with clear errors), and calls ctx.tools.register(defineTool({…})) with a name, description, parameters and an execute function.
Pair the module with a cordis.yml overlay that inserts the plugin id, source path and config values, then boot it:
pnpm dsh web --patch ./start-dsh-plugin/cordis.yml
Ask the model to use the greet tool and it will invoke your code — no restart involved. That hot-plug loop is what makes plugin development feel closer to writing a game mod than an SDK integration.
From patch file to installable bundle
For distribution, add a package.json with a dsh.bundle.patch field pointing at a cordis.patch.yml. Now the directory becomes an installable bundle:
- Local install:
pnpm dsh plugin --profile web add ./start-dsh-plugin - Remove by name:
pnpm dsh plugin --profile web remove start-dsh-plugin - Inspect the resolved config tree:
pnpm dsh web --dump-config
Profiles live under $DSH_HOME/profiles/<name>; web is the preinstalled one.
Publishing: npm, tarball, or GitHub
Before publishing, complete the build chain (package.json, tsconfig.json, tsconfig.local.json), compile to lib/ with pnpm exec tsc, sanity-check contents via pnpm pack --dry-run, then pnpm pack for a tarball or pnpm publish --access public for npm. GitHub installs work too: dsh plugin add github:user/repo.
One real-world gotcha from the original author: the sample plugin fails on latest source because dsh-tools moved to 0.1.2-alpha.1 while the manifest pinned an older release line, breaking a CallId import. The fix was building inside the harness repo. Pin nothing you can't verify against current master.
Where to find plugins — and a dshbase note
The community indexes are DSH Market, Awesome DSH Plugin, and awesome-deepseek-harness on GitHub. But remember the audit rule: a plugin runs with your shell and filesystem in reach. Before adding any bundle, read its execute paths first — the same instinct we bring to every entry in our catalog.
On dshbase
Before installing random GitHub plugins, check the verified directory and audit notes.