Appearance
Kiro 默认使用 open-vsx.org 作为 extension marketplace。企业环境中,往往需要将其替换为内部私有 registry,以便只允许经过审核的插件进入开发环境。配置方式是修改 Kiro 安装目录下的 product.json,将 extensionsGallery 中的三个 URL 字段指向私有服务地址。完成后可通过 MDM 或端点管理方案批量下发到组织内所有设备。
Kiro IDE 扩展注册表:配置私有 extension registry
Kiro 默认通过 open-vsx.org 获取 extension。如果你所在的组织希望限定可用插件范围,或者使用离线的内部 registry,可以将默认来源替换为私有地址。
修改 extension registry
首先找到 Kiro 安装目录中的 product.json 文件,各平台路径如下:
- macOS:
/Applications/Kiro.app/Contents/Resources/app/product.json - Windows:
C:\Program Files\Kiro\resources\app\product.json - Linux:
/usr/lib/code/product.json
用任意编辑器打开该文件,找到 extensionsGallery 字段,将其中的 serviceUrl、itemUrl、resourceUrlTemplate 三个地址改为你的私有 registry 地址。
以 https://registry.example.com 为例,修改后的配置如下:
json
"extensionsGallery": {
"serviceUrl": "https://registry.example.com/vscode/gallery",
"itemUrl": "https://registry.example.com/vscode/item",
"resourceUrlTemplate": "https://registry.example.com/vscode/unpkg/{publisher}/{name}/{version}/{path}",
"controlUrl": "",
"recommendationsUrl": "",
"nlsBaseUrl": "",
"publisherUrl": ""
}保存文件后重启 Kiro,extension 面板中的搜索和安装操作将全部指向新的 registry。
批量下发到组织设备
如果需要统一组织内所有开发者的 extension 来源,可以通过以下方式批量修改 product.json:
- MDM(移动设备管理)方案:如 Jamf、Microsoft Intune,通过配置文件分发脚本
- 端点管理工具:Ansible、Chef、Puppet 等运维自动化工具
- 镜像预置:在制作标准开发镜像时提前写入修改后的
product.json
这样可以确保所有设备统一使用经过审核的内部 registry,避免安装未经批准的 extension。
常见问题
Q:修改 product.json 后升级 Kiro,配置会被覆盖吗?
A:会。Kiro 升级时通常会替换 product.json,需要在升级后重新应用配置。建议将修改步骤写入自动化脚本,纳入版本升级流程。
Q:私有 registry 需要符合什么协议格式?
A:Kiro 的 extension 系统兼容 VS Code 扩展市场 API 协议(Open VSX Registry 协议),私有 registry 需实现相同的接口路径(/vscode/gallery、/vscode/item 等)。
Q:设置了私有 registry 后还能访问 open-vsx.org 上的公共 extension 吗?
A:不能直接访问。切换后所有请求都走私有 registry,需由 registry 管理员将所需的公共 extension 同步至私有服务,或保留对 open-vsx.org 的条目镜像。