返回目錄

dsh-shell-command

精選清單收錄維護狀態: 活躍

chplus0/dsh-shell-command

Claude Code 風格 shell 整合:/! 單命令分析與 /terminal 互動式 PTY 會話。

前往 GitHub
$ dsh plugin add dsh-shell-command

安裝

dsh 沒有統一的安裝指令 —— 把該外掛 README 中的設定行加入你的 profile / patch 設定,然後重啟即可。

查看安裝教學

5

星數

0

Fork

JavaScript

語言

MIT

授權條款

2026-08-16

建立於

2026-10-19

最近推送

README

dsh-shell-command

English | 中文

A DeepSeek Harness plugin that brings Claude Code's ! gesture to DSH, split into two modes:

Command Behavior
/! <command> Run a shell command, analyze its output. Inspired by Claude Code's ! prefix — runs the command in the session workspace and delivers the output to the model for immediate analysis.
/terminal Open an interactive terminal popup. Closing never sends anything to the model — if the session received input, the transcript persists and the panel jumps to a history tab (new entry pre-selected) where you can reference it into the model on demand.

Note: DSH's input trigger system only supports / and @ as trigger characters, so we use /! instead of a bare ! prefix.

Install

Requires the dsh CLI and Node >= 22.

# from a registry / npm
dsh plugin --profile web add dsh-shell-command

# from a local checkout (live link for development)
dsh plugin --profile web add "link:/path/to/dsh-shell-command"

Restart the web surface once (dsh web) so the host-side command loads. It appears in the input / menu automatically.

Quick Start

Your first /! command

Type in the input box:

/! df -h

The command runs immediately, and the output is delivered to the model for analysis. You'll see a message like:

Shell Command Output
Command: df -h
[output here]

The model then analyzes the disk usage and may suggest actions if issues are found.

Your first /terminal session

  1. Type /terminal in the input box
  2. A floating terminal panel opens with two tabs: 会话 (Session) and 历史 (History)
  3. In the Session tab, try some commands:
    pwd
    ls -la
    git status
    
  4. Click 退出 (Exit) in the header to close the terminal
  5. The panel stays open and automatically jumps to the History tab
  6. Your just-closed session is pre-selected and expanded
  7. Choose what to do:
    • Click 引用并分析 to send it to the model for analysis
    • Click 直接退出,本次不分析 to skip and close the panel

Command Details

/! <command> — Single-command analysis

Runs the command in your session workspace and immediately delivers the output to the model for analysis. This is the DSH equivalent of Claude Code's ! prefix.

When to use:

  • Quick status checks: /! git status, /! npm test
  • System diagnostics: /! df -h, /! free -h, /! top -bn1 | head -20
  • File searches: /! find . -name "*.log" -mtime -1
  • One-off operations where you want immediate AI insight

Examples:

/! git log --oneline -10
# → Model summarizes recent commits and may spot patterns

/! npm run build
# → Model analyzes build output, flags warnings or errors

/! ps aux | grep node
# → Model explains running Node processes

Technical details:

  • Output is bounded (maxOutputBytes, tail retained) and formatted for analysis
  • The command text and lifecycle are logged to the trajectory (command/run/command/done)
  • Requires an active model conversation (won't work on the first message before any model request)

/terminal — Interactive terminal

An interactive PTY popup (persistent shell, live WebSocket stream). Best for:

  • Exploratory debugging: run multiple commands, observe behavior
  • Iterative testing: modify → test → modify cycles
  • Multi-step operations: setup → execute → verify workflows

How it works:

Closing the terminal never sends anything to the model automatically:

  • If the session never received input → no trace left (no file, no history entry)
  • If the session received input → transcript persists to <workspace>/.dsh-shell-transcripts/, panel jumps to History tab with the new entry pre-selected

You decide later whether to reference it for analysis (see History Tab workflow below).

Session Tab Features

  • Line-oriented terminal: monospace scrollback + input line
  • Control keys: Ctrl+C/D/Z send raw control bytes to the shell
  • Command history: ArrowUp/ArrowDown recall previously-submitted lines (client-side, max 500 entries)
  • Limitations: Tab-completion not supported; full VT100/xterm (vim, htop) planned for future release

History Tab Workflow

Terminal History Tab

When you close a terminal session that received input, the panel automatically switches to the History tab:

UI Elements:

  1. Checkbox (left): Select one or more history entries for analysis
  2. Timestamp: When each session was closed
  3. View/Collapse button (right): Expand to preview the transcript
  4. Notes textarea (bottom): Optional natural-language context for the model
  5. Default message hint: Shows what the model receives if you leave notes empty: "请帮我分别分析这些历史终端记录。"
  6. Two action buttons:
    • 引用并分析 ("Reference & Analyze"): Send selected entries to the model for immediate analysis
    • 直接退出,本次不分析 ("Exit without analyzing"): Close the panel without sending anything

Typical workflow:

1. Close a terminal session (click "退出")
2. Panel stays open, jumps to History tab
3. Just-closed entry is pre-selected and auto-expanded
4. Review the transcript preview
5. (Optional) Select additional historical entries for comparison
6. (Optional) Add context in the notes field: "Why did the second run fail?"
7. Click "引用并分析" → Model analyzes selected transcripts
   OR click "直接退出,本次不分析" → Panel closes, nothing sent to model

Advanced usage:

  • Compare across runs: Select 2-3 related sessions (e.g., before/after a fix) and ask: "What changed between these attempts?"
  • Guided analysis: Use the notes field to direct the model's attention: "Focus on memory usage patterns"
  • Selective sharing: Not every terminal session needs analysis — only reference what's relevant

在 GitHub 閱讀完整 README →

DSH Plugins 是獨立的 DeepSeek Harness 外掛目錄,與 DeepSeek 官方無關,也不代表官方背書。第三方外掛未經安全稽核,安裝前請審查原始碼。

每週取得最新的 DeepSeek Harness 外掛,絕不濫發。