Skip to main content

dsh-code

27Stars2Forks0Issues0Watchers

The terminal coding interface of DeepSeek Harness, featuring Ink rendering, interactive TUI, persistent sessions, agent presets, model switching, and git workflow commands.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
TypeScript
License
MIT
Branch
main
claude-codeclicodexdeepseekdeepseek-harnessdshdsh-pluginharness

Install

cmdweb profile
$ dsh plugin --profile web add dsh-code

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin UNLINEARITY/dsh-code for me: review the repository at https://github.com/UNLINEARITY/dsh-code first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Description

dsh-code is the terminal coding interface for DeepSeek Harness (dsh), bringing Agent, sessions, models, and tools to the command line, enabling you to start new sessions, run code, edit files, and perform diff reviews directly in the terminal. It runs as an out-of-tree bundle on top of the official @deepseek-ai/dsh-base, sharing the same Cordis registry with the Web UI at runtime.

Core Features

  • Launch interactive TUI with three entry commands: dsh --profile cli, deepseek, and dsh-code (README.md:45-49 / bin/deepseek.mjs:197)
  • Create, resume, recover by ID prefix, and fork persistent sessions; session events can be replayed in the terminal (src/index.ts:255-285 / README.md:62-67)
  • Combine tools, skills, plan mode, and subagent behavior through Agent Presets (standard / code / minimal / cordis / custom); preset selections persist with the session (src/presets.ts:33-46 / README.md:78-79)
  • Switch models, reasoning effort, permission Presets, and subagent model routing within the terminal, writing each selection as a global default (src/index.ts:956-994 / src/index.ts:529-541)
  • Provide /diff and /review workflows, combining git to check changes and perform read-only code review; /export exports conversations as Markdown (README.md:104-108 / src/index.ts:1017-1040)
  • Persist status bar items, theme (dark/light/auto), and input history to JSON/JSONL files under ~/.dsh/dsh-code/ (src/index.ts:555-628)

Technical Implementation

  • Language: TypeScript
  • Key Dependencies: ink (^5.2.1), react (^18.3.1), commander (^14.0.2), @deepseek-ai/dsh-agent (^0.1.0-rc.8)
  • Architecture Pattern: Cordis plugin tree; mounted to host via bundle patch (cordis.patch.yml); declares tui-startup service at startup, tui-runner lazily loads sessions under ctx.tuiStartup.startup injection
  • Entry Files: src/index.ts (runner), src/startup.ts (CLI parsing), bin/deepseek.mjs (launcher wrapper)

Use Cases

Ideal for developers who prefer completing coding work in the terminal: want to run AI programming sessions directly in the command line without switching to the Web UI; need to reuse persistent sessions for long tasks (resuming, forking, resuming across directories); want to invoke the same dsh capability stack in CI or SSH remote environments instead of opening a browser.

Prerequisites and Compatibility

DependencyMin VersionDescription
DeepSeek Harness0.1.0-rc.8Requires global installation of @deepseek-ai/[email protected]; all peer dependencies aligned to ^0.1.0-rc.8
Node.js^22.19 or >=24engines.node declared range (package.json:63)
pnpmAnypnpm used for profile plugin dependency installation; errors if not globally installed (docs/problems.md:127-142)
PlatformmacOS / Windows / LinuxWrapper and TUI cross-platform; Linux requires build-essential to compile node-pty
Native Modulenode-pty (indirect)Introduced by DSH main program; Linux missing prebuilt binaries requires manual node-gyp rebuild

Installation

dsh plugin --profile web add github:UNLINEARITY/dsh-code

Configuration Options

ConfigTypeDescriptionDefault
DSH_TOOLS_MODEEnv VariableControls tool mode injection in cordis.patch.yml; read at runtimeDetermined by process environment, defaults to host if unset
DSH_SETTLED_ROWSEnv VariableMax lines for history replay; 0 disables cap for infinite scroll (src/app.ts:94-99)3000
--theme <name>CLI / PersistentTerminal color scheme: dark, light, or auto; also writes to ~/.dsh/dsh-code/theme.jsondark (README.md:96)
--mode <preset>CLILock Agent Preset for this session at startup; locked after first turnstandard
`--resume <idprefix>`CLIResume persistent session by id or unique prefix
--continue / -cCLIResume the most recently modified session in current directoryNone
--session <id>CLICreate new session with specified id (id must not exist)None
Status Bar Items (~/.dsh/dsh-code/statusline.json)JSON FileUser-level persistent status bar display items; degrades to default if missing or corruptedDefault
Input History (~/.dsh/dsh-code/history.jsonl)JSONL FileSubmitted prompt history, max 500 entries retainedEmpty

FAQ

Q: After startup it reports the cli profile does not mount dsh-code yet, what should I do?

A: This means the alias exists but the profile hasn't mounted the plugin. Run dsh plugin --profile cli add dsh-code (or with version [email protected]) to mount it, then start with the same command (bin/deepseek.mjs:170-179).

Q: pnpm repeatedly prompts allowBuilds when installing from GitHub source?

A: Git packages don't include the release lib/, so they build during the prepare phase. You need to write the full entry from the pnpm prompt (including git URL and commit) to ~/.dsh/profiles/cli/pnpm-workspace.yaml, then rerun the installation command (docs/problems.md:60-99).

Q: Reports Cannot find module './prebuilds/linux-x64/pty.node' on Linux?

A: This is [email protected], a dependency of the DSH main program, missing prebuilt binaries. First run apt install build-essential python3 make g++, then under cd "$(npm root -g)/@deepseek-ai/dsh/node_modules/node-pty" execute npx node-gyp rebuild, confirming build/Release/pty.node has been generated (docs/problems.md:5-58).

Q: After switching models, the subagent is still using the old model?

A: This is normal. Subagents are created with fixed AgentOptions; runtime /model changes won't propagate to subtasks. You can use /subagent to separately specify a subagent model to override the default behavior (src/index.ts:529-541 / README.md:81).

Q: How to completely uninstall?

A: You need to do both: dsh plugin --profile cli remove dsh-code to unmount, and npm uninstall -g dsh-code to remove the global package and deepseek/dsh-code commands. If you only unmount, the alias still exists and shows an error prompt (README.md:255-260).

Q: Switching Preset reports mode is locked after the first turn?

A: This is by design: after the first turn, the Preset is written to session events and locked. To switch Presets, you can only /new <mode> to start a new session (src/presets.ts:60-72).

Q: TUI freezes or want to interrupt the current turn?

A: Esc interrupts the current turn; Ctrl+C is used sequentially to cancel tasks, clear input, and exit; Ctrl+D exits DSH-Code directly. On exit, TUI flushes sessions in order, disposes the agent, waits for the last composition, writes history, then requests exit (README.md:181-188 / src/index.ts:647-682).

Learning Curve

Advanced — requires familiarity with the Cordis plugin model, DSH persistent session event flow, and pnpm workspace mechanism to understand how the bundle patch mounts; regular users can just use dsh --profile cli.

Known Issues and Limitations

  • DeepSeek Harness is still in developer preview (0.1.0-rc.8) and may have breaking changes in the future; dsh-code 1.0.x is built on the rc.8 plugin line and requires keeping global dsh and dsh-code versions in sync (README.md:54 / package.json:73-100)
  • In environments without prebuilt binaries like Linux x64 + Node 24, [email protected] global installation may leave missing pty.node, requiring manual node-gyp rebuild (docs/problems.md:5-58)
  • When creating sessions with custom id via --session <id>, /delete will refuse to delete when falling back to persistent backend SQLite and similar without locatable artifacts (src/index.ts:1098-1125)
  • Resuming subagent sessions is rejected (subagent conversations are read-only); CLI cannot append root turns to persistent logs of subtasks (src/index.ts:276-279)
  • pnpm ignores unpinned versions within 24 hours of package release; GitHub installations on the first day require exact version [email protected]; npm installation is not affected (README.md:38-39)

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/UNLINEARITY/dsh-code)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory