After you write a custom plug-in for the {product-title} CLI, you must install it to use the functionality that it provides.
Important
|
OpenShift CLI plug-ins are currently a Technology Preview feature. |
-
You must have the
oc
CLI tool installed. -
You must have a CLI plug-in file that begins with
oc-
orkubectl-
.
-
If necessary, update the plug-in file to be executable.
$ chmod +x <plugin_file>
-
Place the file anywhere in your
PATH
, such as/usr/local/bin/
.$ sudo mv <plugin_file> /usr/local/bin/.
-
Run
oc plugin list
to make sure that the plug-in is listed.$ oc plugin list The following compatible plugins are available: /usr/local/bin/<plugin_file>
If your plug-in is not listed here, verify that the file begins with
oc-
orkubectl-
, is executable, and is on yourPATH
. -
Invoke the new command or option introduced by the plug-in.
For example, if you built and installed the
kubectl-ns
plug-in from the Sample plug-in repository, you can use the following command to view the current namespace.$ oc ns
Note that the command to invoke the plug-in depends on the plug-in file name. For example, a plug-in with the file name of
oc-foo-bar
is invoked by theoc foo bar
command.