deepseek-harness authoring skill

deepseek-harness (dsh) is the lmctl-ai reference fork of deepseek-ai/deepseek-harness, an open-source agent harness built on the Cordis plugin framework and supported as the dsh provider in lmctl.

Purpose

Use deepseek-harness to build and run the dsh CLI and Web UI on both x64 and arm64 platforms, execute headless prompts (dsh --profile headless), and integrate or test lmctl's dsh provider adapter against live or mocked Anthropic Messages endpoints.

When to use it

Choose deepseek-harness when running the dsh provider in lmctl, when building dsh from source on arm64 Linux machines where the published @deepseek-ai/dsh npm package fails to install, or when qualifying dsh in provider-mock-e2e.

Install

Build from the lmctl-ai/deepseek-harness checkout with Node.js and pnpm (recommended for arm64 compatibility), or launch via npx @deepseek-ai/dsh on supported x64 platforms.

git clone https://github.com/lmctl-ai/deepseek-harness.git
cd deepseek-harness
pnpm install
pnpm run build

Commands

Run dsh in headless CLI mode, start the Web UI server on 127.0.0.1:3080, or run the development watcher.

dsh --version
dsh --profile headless "Explain the plugin lifecycle"
pnpm dsh web --no-open
npx @deepseek-ai/dsh web --no-open
pnpm run dev:web

Inputs and outputs

In headless mode (dsh --profile headless "<prompt>"), dsh reads configuration from DSH_HOME and environment variables (DEEPSEEK_API_KEY, DEEPSEEK_BASE_URL, DSH_TELEMETRY_DISABLED), sends Anthropic Messages requests (POST /v1/messages) to the configured base URL, and prints the plain-text reply on stdout. In web mode (dsh web), it serves the browser UI on http://127.0.0.1:3080.

Safety rules

Always review SAFETY.md before granting dsh access to sensitive workspaces; DeepSeek Harness is in developer preview. In automated tests and CI, always isolate state with a temporary DSH_HOME directory, set DSH_TELEMETRY_DISABLED=1, and pass --no-open when starting dsh web on headless or SSH hosts. Remember that DEEPSEEK_BASE_URL is a trusted environment-tier override and that the default dsh transport sends POST /v1/messages (Anthropic Messages wire format) rather than an OpenAI /v1/chat/completions payload.

Worked examples

Example 1: Running dsh --profile headless in an isolated environment against a loopback mock server.

export DSH_HOME="$(mktemp -d)"
export DSH_TELEMETRY_DISABLED=1
export DEEPSEEK_API_KEY="synthetic-mock-key-129"
export DEEPSEEK_BASE_URL="http://127.0.0.1:4567/v1"
dsh --version
dsh --profile headless "Reply with exactly PROVIDER_MOCK_OK_129. Do not call any tools."

Errors and exit codes

Exit code 0 indicates the headless prompt or command succeeded and printed a response. Non-zero exit codes indicate missing credentials, unreachable DEEPSEEK_BASE_URL endpoints, native addon mismatches on unbuilt npm installs, or runtime plugin errors.

How to verify

Verify the source build completes cleanly and that dsh --version and a loopback headless probe return exit code 0.

dsh --version