Install plug-ins to an application.
Usage
zowe plugins install [plugin...] [options]
Positional Arguments
-
plugin... (string)
-
A space-separated list of plug-ins to install. A plug-in can be any format that is accepted by the `npm install` command (local directory, TAR file, git URL, public package, private package, etc.).
To use a relative local directory, at least one '/' or '\' must exist in the plug-in path. For example, there is a local plug-in in folder 'test-plugin' that you want to install. Specify the relative local directory by issuing the following command:
zowe plugins install ./test-plugin
If you omit the './', the install command looks for 'test-plugin' in an NPM registry.
If the `plugin` argument is omitted, the plugins.json file determines which plug-ins are installed. For more information on the plugins.json file, see the --file entry in the Options section.
Options
-
--file (local file path)
-
The location of a plugins.json file that contains the plug-ins you want to install.
All plug-ins specified in plugins.json are installed to the base CLI and the contents are placed into /home/<user>/.zowe/plugins/plugins.json.
If you do not specify a plugins.json file and do not specify a plug-in, the default plugin.json file (/home/<user>/.zowe/plugins/plugins.json) is used. This provides a way to install plug-ins that were lost or corrupted after reinstalling or updating Zowe CLI.
-
--registry (string)
-
The NPM registry that is used when installing remote packages. When omitted, the value returned by `npm config get registry` is used.
For more information about NPM registries, see: https://docs.npmjs.com/misc/registry
-
--login (boolean)
-
The flag to add a registry user account to install from secure registry. It saves credentials to the `.npmrc` file using `npm login`.
When omitted, credentials from `.npmrc` file are used. If you used this flag once for specific registry, you do not have to use it again, it uses credentials from `.npmrc` file.
For more information about NPM registries, see:
https://docs.npmjs.com/cli/login
-
--verbose (boolean)
-
--allow-scripts (string)
-
A comma-separated list of package names that are allowed to run their NPM install scripts (preinstall, install, postinstall, and prepare). The names must match. Zowe passes this list to NPM as its own --allow-scripts option.
NPM 12 blocks these scripts unless the package is in the list. This breaks plug-ins that have a dependency that must be built during install, such as the Db2 plug-in and its ibm_db dependency. Older versions of NPM do not know this option and ignore it, so using this option does not change how they work. Older versions of NPM may show a warning about the --allow-scripts option being unknown. This warning can be safely ignored. When omitted, Zowe does not pass anything to NPM, and NPM decides what to do.
Only list packages that you trust. Install scripts can run any code on your machine.
Examples
-
Install plug-ins saved in /home/<user>/.zowe/plugins/plugins.json:
zowe plugins install
-
Install plug-ins saved in a properly formatted config file:
zowe plugins install --file /some/file/path/file_name.json
-
Install a remote plug-in:
zowe plugins install my-plugin
-
Install a remote plug-in using semver:
zowe plugins install my-plugin@"^1.2.3"
-
Install a remote plug-in from the specified registry:
zowe plugins install my-plugin --registry https://registry.npmjs.org/
-
Install a local folder, local TAR file, and a git URL:
zowe plugins install ./local-file /root/tar/some-tar.tgz git://github.com/project/repository.git#v1.0.0
-
Install a remote plug-in from the registry which requires authorization(don't need to use this flag if you have already logged in before):
zowe plugins install my-plugin --registry https://registry.npmjs.org/ --login
-
Install a remote plug-in and let one of its dependencies run its npm install scripts:
zowe plugins install my-plugin --allow-scripts="ibm_db"