Momojie-S/dsh-workspace-env
DSH插件:为shell子进程提供按工作区注入.env文件的功能
Project Overview项目介绍
This repository hosts a native DeepSeek Harness (DSH) plugin that adds workspace-level environment variable injection for PowerShell tool calls in DSH. It is packaged as a DSH bundle with a valid DSH manifest, and can be installed directly via DSH's built-in plugin manager. Every time a pwsh command is invoked via DSH's shell service, the plugin automatically reads the .env file from the current workspace root and injects its key-value pairs into the child process environment. This enables automatic environment switching when switching between projects, with no extra configuration or changes required from the DSH agent.
The plugin follows standard .env file conventions, so you can write comments starting with #, leave empty lines, and use variable references like ${PATH} to expand existing environment values. Keys starting with the DSH_* prefix are automatically ignored to avoid conflicting with DSH's internal managed variables. Workspace .env variables take highest priority over system environment variables and any DSH-injected variables of the same name, except for the ignored DSH_* variables. Changes to the .env file take effect immediately after saving, because the file is re-read on every command invocation, so you do not need to restart DSH to apply updates.
The plugin has a minimum DSH version requirement of 0.1.0-rc.6, and has been tested and confirmed working up to DSH version 0.1.5-rc.1. It only supports Windows PowerShell at this time, and does not cover bash-based command execution paths. It is released under the open source MIT license, and can be installed by running the dsh plugin --profile web add github:Momojie-S/dsh-workspace-env command in your terminal. After installation completes, you will need to restart DSH for the plugin to take effect. You can verify the installation by running dsh web --dump-config | Select-String workspace-env to check that the plugin configuration layer is loaded correctly.
这是一款针对DSH开发的原生组合插件,作用是在调用pwsh工具时,自动将当前工作区根目录下 .env 文件中定义的环境变量注入到子进程中,实现了工作区级别的环境变量隔离,切换项目时会自动切换对应环境,整个过程对DSH agent完全透明无感知。该插件支持变量展开、同名覆盖、注释跳过等常见.env特性,安装完成后即可直接使用。
开发者只需要在当前工作会话的根目录放置符合规范的 .env 文件,就可以让所有 pwsh 调用自动读取该文件中的配置。每次调用命令都会重新读取文件,修改配置后无需重启 DSH 即可立即生效。对于需要不同环境变量配置的多项目开发场景,这款插件可以有效避免不同项目之间环境变量互相干扰,降低环境配置的管理成本。
该插件要求 DSH 版本不低于 0.1.0-rc.6,目前已验证兼容至 0.1.5-rc.1,仅支持 Windows 平台的 PowerShell,暂未覆盖 bash 环境。项目采用 MIT 许可证开源,可通过 dsh plugin 命令直接从 GitHub 源码或压缩包安装,安装完成后重启 DSH 即可生效。开发者也可通过源码直连的方式进行本地开发调试。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-workspace-env(Momojie-S/dsh-workspace-env)
仓库:https://github.com/Momojie-S/dsh-workspace-env
本站详情页:https://www.yhbd.top/plugins/momojie-s-dsh-workspace-env/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-09-12 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add momojie-s-dsh-workspace-env-0.1.0.tgz
把 Momojie-S/dsh-workspace-env 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-workspace-env
npm 包名:
@momojie-s/dsh-workspace-env
DSH 插件:pwsh 工具每次调用时,自动把当前 workspace 目录下的 .env 注入子进程环境变量——workspace 级环境变量隔离,切项目自动切 env,agent 无感知。
环境要求
- DSH
>= 0.1.0-rc.6(已验证至0.1.5-rc.1:.env注入实测正常。依赖 shell 服务的spawnSpec内部方法,升级 DSH 后建议重跑验证) - Windows pwsh(bash 链路未覆盖)
用法
workspace 根目录(session cwd)放一个 .env:
GH_TOKEN=gho_xxx
QUOTED="value with spaces" # 成对单/双引号自动去除
PATH=D:\mytools;${PATH} # ${VAR} 引用父环境,PATH 前置追加
# # 开头是注释;空行、无 = 的行跳过
.env每次命令调用现读,改完立即生效,无需重启DSH_*前缀的 key 一律忽略(DSH 管理变量有自己的通道)- 同 key 覆盖:workspace
.env优先级最高,赢过系统环境变量、DSH 注入的一切同名变量(DSH_*除外) ${VAR}引用:展开自父环境(系统变量 + DSH 注入)+ 同文件中更早定义的变量;未定义展开为空串。覆盖是整体替换,要追加就用引用:PATH=D:\tools;${PATH}
安装
本插件是组合包(dsh.bundle),用 dsh plugin 安装进 profile,自动追加配置层,无需手编 patch:
# GitHub(私仓需 git 凭据;pnpm ≥10 首次 add 会提示授权构建,按提示把包键
# 写进 ~/.dsh/profiles/web/pnpm-workspace.yaml 的 allowBuilds 后重新 add)
dsh plugin --profile web add github:Momojie-S/dsh-workspace-env
# 或 tarball(pnpm pack 产物,无授权要求)
dsh plugin --profile web add momojie-s-dsh-workspace-env-0.1.0.tgz
验证层就位后重启 DSH:
dsh web --dump-config | Select-String workspace-env # 应看到 "# == dsh-workspace-env" 层
开发模式:源码直连(改代码 → 重启验证)
编译 npm install && npm run build,profile 的 cordis.patch.yml 手动加行(name 用 file:/// URL 指向 lib/index.js):
- insert:
- id: workspace-env
name: file:///D:/code/workspace/deepseek-harness-101/plugins/dsh-workspace-env/lib/index.js
disabled: !!js process.platform !== 'win32'
独立追加行,不替换
pwsh-sandbox——文件沙箱能力完整保留(patch 也禁止 id override 改name)。
配置
无。
验证
workspace 放 .env 写 WS_ENV_TEST=hello,让 agent 跑:
pwsh: echo $env:WS_ENV_TEST
输出 hello 即生效;切到无 .env 的目录同命令输出空,即隔离生效。
设计文档见 docs/design/overview.md;跨插件开发方法论见合集仓库 docs/development-guide/dsh-plugin-development.md。
esengine/DeepSeek-Reasonix
strukto-ai/mirage
chuspeeism/dashi-taskboard
Aisland-SJL/dsh-worktable
ccch1mneyyy/working-activity
zhoushoujianwork/easyeda-agent
pulseaiclub/phi
Ikalus1988/MisakaNet