Skip to main content

How to use dsh-code

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

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

dsh-code

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add dsh-code

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

  • 使用 /new 新建会话,或通过 /resume、--continue 恢复已有会话
  • 使用 /fork 从历史节点创建新的工作分支,同时保留原会话
  • 按当前目录、更新时间和会话范围搜索历史记录
  • 使用 Up/Down 召回输入历史,或通过 /history 搜索过去的提示词
  • 支持持久标题、Markdown 导出、上下文占用、token、缓存、TTFT 和耗时统计

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

What command is used to start after installation?

All three commands dsh --profile cli, deepseek, and dsh-code can start the same TUI (README.md:45-49 / bin/deepseek.mjs:197). Among them, deepseek and dsh-code are global aliases, and parameters are forwarded as-is.

Do I need to install the DSH main program first?

Yes. dsh-code is an out-of-tree bundle. You need to first npm install -g @deepseek-ai/[email protected], then mount dsh-code to the cli profile using dsh plugin --profile cli add dsh-code; the alias will check the profile when starting, and will directly report an error if not mounted (bin/deepseek.mjs:170-179).

Can I enter TUI without configuring a model?

Yes. Without model configuration, you can still enter the terminal, view historical sessions, and use non-model commands like /help, /theme, and /statusline; press a in the /model panel to add an API key via the Harness credentials service (README.md:26 / src/models.ts:1-9).

How to switch Agent Preset?

Use --mode <preset> at startup, or /mode <preset> in session, or /mode to browse and select; presets (standard / code / minimal / cordis / user-defined) can be changed before the first turn, and will be restored with persistence after being written to session events (src/presets.ts:33-46 / README.md:78-79).

How to resume and fork sessions?

--resume <id|prefix> resumes the specified session, --continue resumes the most recent session in the current directory, /fork creates a branched session from the most recent turn or specified event position while preserving the original session; sub-agent sessions are read-only and cannot be appended to via CLI (src/index.ts:255-285 / README.md:65).

What slash commands are supported?

/new /resume /fork /delete /title /export /history /clear for session management; /mode /model /effort /permission /subagent for agent and permissions; /diff /review /todos /agents /jobs /copy for coding and background tasks; /plugin /statusline /theme /help /quit for extensions, display, and exit (README.md:128-167).

Where is data stored?

Persistent sessions are stored at the Harness backend default location; user-level configuration is under ~/.dsh/dsh-code/, storing statusline.json, theme.json, and history.jsonl respectively (src/index.ts:555 / src/index.ts:582 / src/index.ts:608).

What should I note when uninstalling?

Both steps must be executed: dsh plugin --profile cli remove dsh-code to unmount the profile, then npm uninstall -g dsh-code to delete the global package and startup alias; when only unmounting, the alias still exists and reports an error (README.md:255-260).

What to do if pty.node is not found on Linux?

DSH's local subprocess plugin depends on [email protected]. When pre-built binaries are missing, you need to first install build-essential/python3/make/g++, then manually npx node-gyp rebuild in the corresponding directory, and confirm build/Release/pty.node has been generated (docs/problems.md:5-58).

How to troubleshoot GitHub source installation failure?

pnpm will report allowBuilds during the Git package preparation phase. You need to write the full entry (including git URL and commit) to ~/.dsh/profiles/cli/pnpm-workspace.yaml and retry; published packages include lib/ and don't require this step (docs/problems.md:60-99).

— source: plugin_wiki.faq_json

Compatibility

  • DSH: >=0.1.0-rc.8
  • Node: ^22.19 || >=24
  • Platforms: macOS, Windows, Linux
  • Native modules: node-pty(DSH 主程序间接依赖)

— source: plugin_wiki.compatibility_json

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule