插件是用于扩展Copilot CLI功能的包。 可以从您已通过 CLI 注册的市场中安装插件。
有关概述,请参阅“用于 GitHub Copilot 的插件”。
注意
可以通过在终端中输入 copilot plugin [SUBCOMMAND] --help 来查找有关使用插件的帮助。
查找插件
插件汇集于市场中。 插件市场是一个可供浏览和安装插件的目录。
Copilot CLI默认包含awesome-copilot市场。
若要列出已注册的市场,请输入:
copilot plugin marketplace list
copilot plugin marketplace list
在交互式会话中,输入:
/plugin marketplace list
/plugin marketplace list
若要在已注册的应用市场中浏览插件,请输入:
copilot plugin marketplace browse MARKETPLACE-NAME
copilot plugin marketplace browse MARKETPLACE-NAME
将 MARKETPLACE-NAME 替换为市场名称。
在交互式会话中,输入:
/plugin marketplace browse MARKETPLACE-NAME
/plugin marketplace browse MARKETPLACE-NAME
安装插件
若要从已注册的市场安装插件,请输入:
copilot plugin install PLUGIN-NAME@MARKETPLACE-NAME
copilot plugin install PLUGIN-NAME@MARKETPLACE-NAME
例如,若要从database-data-management中安装awesome-copilot,请输入:
copilot plugin install database-data-management@awesome-copilot
copilot plugin install database-data-management@awesome-copilot
在交互式会话中,输入:
/plugin install PLUGIN-NAME@MARKETPLACE-NAME
/plugin install PLUGIN-NAME@MARKETPLACE-NAME
还可以从 GitHub 存储库、Git URL、存储库子目录或本地路径安装插件。 有关接受的格式,请参阅install命令的插件规范。
管理已安装的插件
使用以下命令管理已安装的插件:
copilot plugin list copilot plugin update PLUGIN-NAME copilot plugin uninstall PLUGIN-NAME copilot plugin disable PLUGIN-NAME copilot plugin enable PLUGIN-NAME
copilot plugin list
copilot plugin update PLUGIN-NAME
copilot plugin uninstall PLUGIN-NAME
copilot plugin disable PLUGIN-NAME
copilot plugin enable PLUGIN-NAME
disable 可在不卸载插件的情况下将其关闭。
uninstall 将其删除。 有关所有命令和选项,请参阅 GitHub Copilot CLI 插件参考。
添加市场平台
若要注册在 GitHub 存储库中托管的市场,请输入:
copilot plugin marketplace add OWNER/REPOSITORY
copilot plugin marketplace add OWNER/REPOSITORY
将 OWNER/REPOSITORY 替换为托管市场的存储库。 例如:
copilot plugin marketplace add anthropics/claude-code
copilot plugin marketplace add anthropics/claude-code
在交互式会话中,输入:
/plugin marketplace add OWNER/REPOSITORY
/plugin marketplace add OWNER/REPOSITORY
还可以从本地目录或托管在其他位置的 Git 存储库添加市场源。 对本地源使用市场目录路径:
copilot plugin marketplace add /PATH/TO/MARKETPLACE-DIRECTORY
copilot plugin marketplace add /PATH/TO/MARKETPLACE-DIRECTORY
对于托管在其他位置的 Git 存储库,请使用其 Git URL:
copilot plugin marketplace add https://gitlab.com/OWNER/REPO.git
copilot plugin marketplace add https://gitlab.com/OWNER/REPO.git
有关发布 GitHub托管市场的指导,请参阅 在 GitHub 上创建和共享插件市场。
删除应用市场
若要取消注册应用市场,请输入:
copilot plugin marketplace remove MARKETPLACE-NAME
copilot plugin marketplace remove MARKETPLACE-NAME
在交互式会话中,输入:
/plugin marketplace remove MARKETPLACE-NAME
/plugin marketplace remove MARKETPLACE-NAME
添加市场时,可以通过其源标识它。 删除它时,请使用市场列表中显示的市场名称。 如果仍安装了来自市场的插件,该命令将失败。 添加 --force 以也卸载这些插件。
关闭存储库默认设置
存储库默认值是可选的。 若要关闭由存储库设置启用的插件,请在false中的.github/copilot/settings.local.json里添加enabledPlugins条目:
{
"enabledPlugins": {
"PLUGIN-NAME@MARKETPLACE-NAME": false
}
}
{
"enabledPlugins": {
"PLUGIN-NAME@MARKETPLACE-NAME": false
}
}
将标识符替换为插件的名称和市场名称。 保存文件并启动新会话。 若要重新打开插件,请将条目设置为 true.
不要提交此本地设置文件。 企业托管设置优先于存储库默认值和本地覆盖。 有关详细信息,请参阅 GitHub Copilot CLI 配置目录。