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.
설치
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:1020252969/dsh-dev-runner配置
两个来源,一张生效表:
/.dev-runner/projects.json—— 面板写入的文件,归插件所有并由它编辑。(DSH_HOME取%DSH_HOME%;宿主没设时用~/.dsh。)- 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 | 该项目额外的环境变量 |
role | backend / frontend / service / infra(展示与发现排序) |
framework | 自由标签(spring、uni-app 等) |
readyPort、readyHost | TCP 就绪探测 |
readyUrl | HTTP 就绪探测(优先;任何响应即算就绪,并报出状态码) |
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:
/.dev-runner/projects.json— written by the panel. This is the file the plugin owns and edits. (DSH_HOMEis%DSH_HOME%when the host sets it, otherwise~/.dsh.)- the profile patch — the
projectsarray underconfigfor thedev-runnerentry incordis.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:
| Field | Meaning |
|---|---|
id | unique; the API and dependsOn address projects by it |
name | label shown in the panel |
cwd | absolute working directory |
command | the long-running command |
args | appended to command |
env | extra environment variables for this project |
role | backend / frontend / service / infra (display + discovery ordering) |
framework | free-form label (spring, uni-app, …) |
readyPort, readyHost | TCP readiness probe |
readyUrl | HTTP readiness probe (takes precedence; any response counts, the status is reported) |
readyTimeoutMs | how long readiness may take (default 120000) |
stopGraceMs | grace before a forced stop (default 8000) |
autoRestart | restart after an unexpected exit |
oneShot | the command is supposed to exit: exit code 0 ends in done, not failed, and it is never restarted. A dependent counts it as satisfied |
restartDelayMs | delay before that restart (default 1000) |
dependsOn | ids that must be running first |
before | pre-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.