使用插件扩展 IBM Cloud CLI

IBM Cloud® 命令行界面支持插件框架,以扩展其功能。 从资源库、URL 安装插件,或在本地安装插件二进制文件。

有关管理插件的更多命令,请运行 ibmcloud plugin 以查看帮助消息。 有关更多信息,请参阅 添加和删除 IBM Cloud CLI 插件

准备工作

安装独立 IBM Cloud CLI,以便您可以为 IBM Cloud安装 CLI 插件。

搜索插件

使用 ibmcloud plugin repo-plugins 命令可发现存储库中的所有可用插件。

ibmcloud plugin repo-plugins
Status             Name                                        Versions                       Description
Update Available   container-service/kubernetes-service        0.3.49, 0.3.47, 0.3.34...      IBM Cloud Kubernetes Service for management of Kubernetes clusters
Update Available   cloud-functions                             1.0.32, 1.0.30, 1.0.29...      Manage Cloud Functions
...

从 IBM Cloud CLI 存储库安装插件

安装特定插件

使用 ibmcloud plugin install PLUGIN_NAME 命令来安装特定插件。 例如,使用以下命令来安装 IBM Cloud Code Engine CLI 插件:

ibmcloud plugin install code-engine
Looking up 'code-engine' from repository 'IBM Cloud'...
Plug-in 'code-engine 1.23.2' found in repository 'IBM Cloud'
Attempting to download the binary file...
 54.29 MiB / 54.29 MiB [============================================] 100.00% 10s
56929376  bytes downloaded
Installing binary...
OK
Plug-in 'code-engine 1.23.2' was successfully installed into /Users/username/.bluemix/plugins/code-engine. Use 'ibmcloud plugin show code-engine' to show its details.

安装所有插件

使用 plugin install -a 命令来安装存储库中的所有最新可用插件:

ibmcloud plugin install -a

安装多个插件

使用 plugin install PLUGIN_NAME@VERSION 命令可同时安装多个插件。 例如,使用以下命令来安装 container-service@1.0.506 和 secrets-manager@0.1.25 插件:

ibmcloud plugin install container-service@1.0.506 secrets-manager@0.1.25

有关更多信息,请参阅 ibmcloud plugin install

确认已安装的插件

使用 plugin list 命令来确认所有必需插件都安装在 IBM Cloud CLI 中。 plugin list 命令针对安装的每个插件返回以下信息:

  • 插件名称
  • 插件的当前版本
  • 插件是否有最新版本
  • 插件版本是否支持私人端点使用
ibmcloud plugin list

更新已安装的插件

使用 plugin update 命令来更新 IBM Cloud CLI 中安装的插件。 plugin update 命令针对安装的每个插件返回以下信息:

  • 当前插件版本
  • 现有的最新插件版本
ibmcloud plugin update

相关信息

您还可以从 URL 安装插件、下载插件或在本地安装插件二进制文件: