跪拜 Guibai
← All articles
Backend

DeepSeek Harness CLI: Every dsh Command, Flag, and Footgun in One Place

By 苏三说技术 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A CLI that mixes launcher flags and application arguments with a strict ordering rule will silently misbehave rather than error out. Knowing that `dsh --port 8080 --profile web` is broken while `dsh --profile web --port 8080` works saves debugging time that the tool itself won't help you with.

Summary

The `dsh` command is the entry point for DeepSeek Harness, loading plugin stacks as agent instances through profiles. Two profiles ship built-in: `web` for the browser UI and `headless` for one-shot tasks that print results and exit. Custom profiles must be created manually via `dsh plugin`.

Plugin management forwards pnpm operations to a profile directory, so installing or removing a plugin is a single `dsh plugin --profile <name> add/remove` command. Configuration inspection uses `--dump-default-config` for the base defaults and `--dump-config` for the fully merged result, while `--patch` applies a one-time overlay without touching files.

The sharpest edge is parameter order: the launcher stops parsing its own flags at the first unrecognized token and passes everything else to the application. Putting `--port 8080` before `--profile web` means the launcher never sees the profile flag. Headless mode returns exit code 0 on success and non-zero on failure, making it scriptable for CI/CD pipelines.

Takeaways
`dsh web` is an alias for `dsh --profile web` and starts the browser UI on port 3080.
`dsh --profile headless "task"` runs a one-shot agent job, prints the result, and exits with code 0 on success or non-zero on failure.
Custom profiles beyond `web` and `headless` must be created first with `dsh plugin` before they can be launched.
`dsh plugin --profile <name> add/remove` forwards pnpm commands to install or remove plugins for a specific profile.
`--dump-default-config` prints the built-in defaults; `--dump-config` prints the final merged configuration after all layers are applied.
`--patch <file>` applies a one-time configuration overlay that replaces entire config values rather than deep-merging keys.
The launcher parses only its own flags; the first unrecognized token and everything after it becomes application arguments.
`dsh --help` shows launcher flags; `dsh --profile web --help` shows the web application's own flags.
Requires Node.js ≥ 22 and is currently at version 0.1.0-rc.6, a developer preview.
Three startup methods exist: `npx` for one-off use, global `npm install` for daily use, and building from source with pnpm.
Conclusions

Parameter ordering rules that silently swallow flags instead of rejecting them are a design choice that shifts the debugging burden entirely onto the user.

The headless mode's exit-code contract is the feature that makes Harness viable in CI/CD; without it, scripted agent runs would need brittle output parsing.

Forwarding plugin management to pnpm rather than inventing a new package manager is pragmatic, but it means plugin installation failures inherit pnpm's sometimes opaque error messages.

Concepts & terms
Profile
A runtime configuration in DeepSeek Harness formed by stacking multiple plugin packages in sequence. The CLI loads a profile to run an agent instance with a specific set of capabilities.
Headless mode
A non-interactive execution mode where the agent runs a single task, prints the result, and exits. Designed for scripting, batch processing, and CI/CD pipelines.
Patch overlay
A one-time configuration override applied via `--patch <file>` that replaces entire config values at the target line rather than performing a deep merge of individual keys.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗