DeepSeek Harness (DSH) provides a plugin- and profile-based architecture. The official dsh-headless mode submits a task once and exits, making it suitable for script invocation. dsh-cli-interactive is an out-of-tree Profile Bundle layered on top of the official dsh-base. It reuses DSH’s core capabilities (Agent loop, session persistence, tool calling) and replaces headless’s “submit and exit” behavior with a persistent interactive terminal (REPL). It does not mount Host / HTTP / browser plugins, keeping the format purely terminal-based.
Core Features¶
This plugin provides the following features:
- Interactive terminal (REPL): Input is treated as a message, and Agent replies are streamed.
- Session persistence: After each turn, the session is persisted to
$DSH_HOME/sessions/*.jsonl. - Session resumption: Use the
--resumeargument to restore a historical session and continue the conversation. - Terminal approval: Confirm permission requests directly in the terminal with
y/n. - Slash commands: Supports commands such as
/help,/sessions,/model,/permission,/cancel,/session,/workspace, and/exit. - Input history and completion: Input history is saved to
$DSH_HOME/cli.history, with Tab completion supported. - Zero build toolchain: Requires only Node.js 22+; no additional build tools are needed.
- No network plugins: Does not mount Host, HTTP, or browser plugins.
Installation and Activation¶
Before use, the following conditions must be met:
* Node.js version >= 22.
* @deepseek-ai/dsh is installed globally.
Install the plugin into the cli profile:
dsh plugin --profile cli add file:$PWD/dist
After installation, use dsh --profile cli --dump-config to verify the combined profile layer.
Typical Usage¶
Enter the REPL:
dsh --profile cli
Run one task first, then enter the REPL:
dsh --profile cli "先 review 一下代码库"
Run once and exit (script-friendly mode):
dsh --profile cli --once "先 review 一下代码库"
Resume a previous session:
dsh --profile cli --resume session-xxxx
Switch the model:
dsh --profile cli --model deepseek-v4-pro
Pipe input:
echo "任务" | dsh --profile cli --once
Applicable Scenarios and Notes¶
Applicable scenarios: Code review, debugging, or workflow monitoring that require long-running, multi-turn conversations.
Known limitations:
1. Single Agent, single process: One CLI process only supports one session. Multiple sessions require multiple processes.
2. In-memory sessions: Sessions exist only in the memory of the running process. After the process exits, recovery relies on on-disk logs combined with --resume.
3. No Web functionality: Browser UI or API endpoints are not supported.
4. Terminal-dependent approval: In unattended automation scenarios, approval requests may block while waiting for input. It is recommended to preconfigure /permission never or the environment variable DSH_PERMISSION_MODE=danger-full-access as a preset policy.
5. Non-TTY limitation: In pipe mode, spinners or activity lines are not rendered; only text and a per-turn summary are output.
6. Synchronization contract: The plugin’s apply() method must execute synchronously; otherwise, it may cause a deadlock.
Summary¶
dsh-cli-interactive encapsulates DSH’s underlying capabilities into a Claude Code-like CLI interface. Through persistent REPL, session management, and terminal approval, it addresses the need to shift from scripted invocation to interactive collaboration. Developers can integrate it quickly with a simple Profile install.
- Project directory: dsh-cli-interactive
- Source repository: GitHub