1020252969/dsh-dev-runner ↗★ 0

dsh-dev-runner

One-click start for a whole dev stack: discover projects and their run commands, orchestrate a backend plus any number of frontends, and follow every log from the right sidebar.

套件
dsh-dev-runner
相容性
待驗證
Harness 依賴範圍
>=0.2.0-rc.2 || >=0.2.1-rc.2 || >=0.2.2-alpha.3
版本
0.3.1
授權
MIT
最近更新
2026年11月7日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:1020252969/dsh-dev-runner

配置

两个来源,一张生效表:

  1. /.dev-runner/projects.json —— 面板写入的文件,归插件所有并由它编辑。(DSH_HOME 取 %DSH_HOME%;宿主没设时用 ~/.dsh。)
  2. profile 补丁 —— cordis.patch.yml 里 dev-runner 条目 config 下的 projects 数组。

两者同时存在时以存储文件为准。GET /status 与面板都会报出当前生效的来源(store、store-empty 或 config),所以「我写的 YAML 没生效」永远有明确答案:被面板自己的文件接管了。删掉那个文件即可回退到 profile 补丁。

- insert:
    - id: dev-runner
      name: 'dsh-dev-runner'
      config:
        discoverDepth: 2
        projects:
          - id: backend
            name: API
            cwd: 
            command: mvn -Dmaven.test.skip=true spring-boot:run
            role: backend
            readyPort: 8080
            readyTimeoutMs: 180000
            env:
              SPRING_PROFILES_ACTIVE: dev
          - id: frontend
            name: 商城前端
            cwd: 
            command: npm run dev:h5
            role: frontend
            readyPort: 5173
            args: -- --host
            dependsOn: [backend]
            autoRestart: true
            before:
              - name: 生成接口代码
                command: npm run gen:api
                expect: 'generated'

项目字段:

字段含义
id唯一标识;API 与 dependsOn 都用它寻址
name面板显示名
cwd绝对工作目录
command常驻命令
args追加到 command 之后
env该项目额外的环境变量
rolebackend / frontend / service / infra(展示与发现排序)
framework自由标签(spring、uni-app 等)
readyPort、readyHostTCP 就绪探测
readyUrlHTTP 就绪探测(优先;任何响应即算就绪,并报出状态码)
readyTimeoutMs就绪最多等多久(默认 120000)
stopGraceMs强停前的宽限(默认 8000)
autoRestart非正常退出后自动重启
oneShot这条命令本来就该退出:退出码 0 结束为 done 而非 failed,且永不自动重启;依赖它的项目照样算「已满足」
restartDelayMs重启前延时(默认 1000)
dependsOn必须先运行的项目 id
before启动前步骤:name、command、expect(可选,输出必须包含的子串)、timeoutMs、continueOnError

关于环境变量的一条要紧语义:插件只发送你声明的变量。宿主会先从父环境里剔除凭据与 DSH_*,再合并你给的这一份;因此开发服务器不会继承那些刚被宿主摘掉的东西。确有需要请显式声明。

Configuration

Two sources, one effective table:

  1. /.dev-runner/projects.json — written by the panel. This is the file the plugin owns and edits. (DSH_HOME is %DSH_HOME% when the host sets it, otherwise ~/.dsh.)
  2. the profile patch — the projects array under config for the dev-runner entry in cordis.patch.yml.

The store file wins when it exists. GET /status and the panel both report which source is live (store, store-empty or config), so a table that "ignored" your YAML is never a mystery: it was superseded by the panel's own file. Delete that file to fall back to the profile patch.

- insert:
    - id: dev-runner
      name: 'dsh-dev-runner'
      config:
        discoverDepth: 2
        projects:
          - id: backend
            name: API
            cwd: 
            command: mvn -Dmaven.test.skip=true spring-boot:run
            role: backend
            readyPort: 8080
            readyTimeoutMs: 180000
            env:
              SPRING_PROFILES_ACTIVE: dev
          - id: frontend
            name: Shop UI
            cwd: 
            command: npm run dev:h5
            role: frontend
            readyPort: 5173
            args: -- --host
            dependsOn: [backend]
            autoRestart: true
            before:
              - name: codegen
                command: npm run gen:api
                expect: 'generated'

Per-project fields:

FieldMeaning
idunique; the API and dependsOn address projects by it
namelabel shown in the panel
cwdabsolute working directory
commandthe long-running command
argsappended to command
envextra environment variables for this project
rolebackend / frontend / service / infra (display + discovery ordering)
frameworkfree-form label (spring, uni-app, …)
readyPort, readyHostTCP readiness probe
readyUrlHTTP readiness probe (takes precedence; any response counts, the status is reported)
readyTimeoutMshow long readiness may take (default 120000)
stopGraceMsgrace before a forced stop (default 8000)
autoRestartrestart after an unexpected exit
oneShotthe command is supposed to exit: exit code 0 ends in done, not failed, and it is never restarted. A dependent counts it as satisfied
restartDelayMsdelay before that restart (default 1000)
dependsOnids that must be running first
beforepre-launch steps: name, command, expect (optional required substring), timeoutMs, continueOnError

Environment semantics worth knowing: the plugin sends only the variables you declare. The host strips credentials and DSH_* from the parent environment before merging yours, so a dev server never inherits what the host removed. If a tool needs one of those variables, declare it explicitly.