除了从活水插件市场安装,你还可以从任意 Git 仓库直接安装插件。
快速开始
# 从 GitHub 安装
42plugin install github.com/anthropics/skills
# 从 CNB 安装
42plugin install cnb.cool/cnb/skills/cnb-skill
# 只安装仓库中的某个 Skill
42plugin install github.com/anthropics/skills/pptx
支持的平台
只要能 git clone,就能 42plugin install:
| 平台 | 格式 |
|---|
| GitHub | github.com/owner/repo |
| CNB | cnb.cool/org/group/project |
| GitLab | gitlab.com/group/repo |
| Gitea | gitea.com/owner/repo |
| 任意 Git 仓库 | 支持 HTTPS 和 SSH 协议 |
支持的 URL 格式
CLI 对输入格式做了充分兼容:
| 格式 | 示例 |
|---|
| 快捷格式(推荐) | github.com/owner/repo |
| 完整 URL | https://github.com/owner/repo |
| 指定单个 Skill | github.com/owner/repo/skill-name |
| 带协议指定 Skill | https://github.com/owner/repo/skill-name |
| 指定分支和路径 | https://github.com/owner/repo/tree/main/skills/xxx |
| GitLab 格式 | https://gitlab.com/group/repo/-/tree/main/skills |
| CNB 三级路径 | cnb.cool/org/group/project |
| SSH 协议 | git@github.com:owner/repo |
你可以直接复制粘贴 Git 仓库的网址,CLI 会自动识别格式。省略 https:// 也没问题,CLI 会自动补全。
批量安装与单独安装
批量安装——指向仓库地址,CLI 自动扫描所有可安装的插件,你选择要装哪些:
42plugin install https://github.com/anthropics/skills
42plugin install https://github.com/microsoft/skills
单独安装——在仓库地址后加上 Skill 名称,精确安装:
42plugin install github.com/anthropics/skills/pptx
更新 Git 安装的插件
Git 安装的插件支持自动更新检查:
CLI 会通过 git ls-remote 比对远程仓库的最新版本,发现更新后自动拉取。
安全检查
从 Git 仓库直接安装的插件未经市场审核,CLI 内置了安全扫描:
- 检测可疑的二进制文件
- 扫描敏感文件(如
.env、凭证文件)
- 识别危险代码模式(如
eval、exec)
发现风险时,CLI 会显示黄色警告并征求确认。请仔细查看详情后决定是否继续安装。
配额与权限
Git 直装需要登录。如果尚未登录,请先运行:
| 能力 | 免费版 | Pro 版 |
|---|
| 公开仓库安装 | 42 次/天 | 420 次/天 |
| 私有仓库安装 | — | 420 次/天 |
- 按仓库计数:一个仓库安装多个插件只算 1 次配额
- 公开仓库人人可装,私有仓库 Pro 专属
安装选项
| 选项 | 说明 |
|---|
--global | 全局安装,对所有项目生效 |
--force | 强制重新克隆仓库 |
--no-cache | 跳过本地缓存 |
--copy | 复制文件而非符号链接 |
下一步