xiayuhkust/dsh-shell-kit--packages-script-exec0

dsh-plugin-script-exec

run_script tool for DeepSeek Harness: write multi-line scripts to a temp file and execute, avoiding Windows inline-quoting pitfalls.

AI Analysis

核心用途是解决Windows系统下多行脚本执行时的转义和乱码问题。适合经常需要在DSH中运行pwsh、python或node脚本的Windows用户。

Package
dsh-plugin-script-exec
Version
0.1.0
License
MIT
Last updated
Aug 15, 2026

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗

dsh-plugin-script-exec

给 DeepSeek Harness 增加 run_script 工具:脚本先写入临时文件再执行(pwsh / python / node),执行后删除。

Windows 上内联传递多行脚本(pwsh -Commandpython -c)在含引号、中文时频繁因转义失败,agent 往往要试错多次。落盘执行绕开转义问题;pwsh 文件带 UTF-8 BOM(PowerShell 5.1 对无 BOM 的 UTF-8 按 ANSI 解码,中文会乱码)。

执行走 ctx.shell,与内置 pwsh 工具同一沙箱与超时策略,不新增权限面。

安装

dsh plugin --profile web add -w dsh-plugin-script-exec

cordis.patch.yml 挂载(用 - insert:):

- insert:
    - id: script-exec
      name: dsh-plugin-script-exec
      config:
        timeoutMs: 120000        # 单次脚本超时,默认 120000
        maxOutputChars: 30000    # stdout/stderr 各自截断长度,默认 30000

重启 dsh web 生效。

工具 run_script

参数说明
languagepwsh / python / node
code脚本源码;写入临时文件,pwsh 自动加 BOM
description可选,一句话说明脚本用途

返回 exitCodestdoutstderr

License

MIT