Bundle
dsh-license-guard
依赖许可证合规:扫描 node_modules 许可证、归一化 SPDX 标识、按宽松/弱传染/强传染分类,并做发布前合规校验
- Source
- uckkk
- stars
- 1 stars
- License
- MIT
- Updated
- Updated 5 days ago
Readme
# dsh-license-guard · 依赖许可证合规 扫描项目 `node_modules` 中每个依赖的许可证,归一化为 **SPDX 标识**,按「宽松 / 弱传染 / 强传染 / 未知 / 未授权」分类,并支持发布前的**允许/禁止策略校验**。纯 Node 实现,无网络、无外部服务。 ## 提供的工具 | 工具 | 作用 | |---|---| | `license_scan` | 扫描全部依赖许可证,分类汇总 | | `license_check` | 按允许/禁止策略校验,返回违规依赖 | ## 安装 ```bash dsh plugin add dsh-license-guard ``` 安装后在 profile 的 `package.json` 的 `dsh.profile.bundles` 中加入 `"dsh-license-guard"`。 ## 用法示例 ``` 看看这个项目依赖的许可证构成 → 调用 license_scan(root="/workspace") 发布前做一次合规门禁 → 调用 license_check(root="/workspace", deny=["AGPL-3.0"]) ``` ## 默认策略 - **默认允许**:MIT、Apache-2.0、ISC、BSD、0BSD、Zlib、Unlicense、CC0-1.0 等宽松许可证。 - **默认禁止**:GPL-3.0、AGPL-3.0、SSPL-1.0、GPL-2.0 等强传染许可证。 - 未知 / 未授权许可证默认计入违规(可用 `includeUnknown: false` 关闭)。 ## 说明 - 许可证识别基于各依赖 `package.json` 的 `license` / `licenses` 字段,识别不到的会标记为「未知」。 - 这属于**启发式合规筛查**,正式商用/发布前请以法律复核为准。 ## 安装 ```bash dsh plugin add github:uckkk/dsh-license-guard ``` > 安装即在本机运行第三方代码,请自行审阅源码。 ## 安装 ```bash dsh plugin add github:uckkk/dsh-license-guard ``` ## 使用 安装后在会话中调用该插件注册的工具即可。 ## 许可 MIT > 安装即在本机运行第三方代码,请自行审阅源码。
Install
dsh plugin --profile web add github:uckkk/dsh-license-guard
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-license-guard from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.