1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/cli-extending-plugins-installing.adoc
2020-08-10 13:44:18 -04:00

76 lines
2.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/extending-cli-plugins.adoc
[id="cli-installing-plugins_{context}"]
= Installing and using CLI plug-ins
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.
ifdef::openshift-enterprise,openshift-webscale[]
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access to
upcoming product features, enabling customers to test functionality and provide
feedback during the development process.
See the link:https://access.redhat.com/support/offerings/techpreview/[Red Hat
Technology Preview features support scope] for more information.
endif::[]
====
.Prerequisites
* You must have the `oc` CLI tool installed.
* You must have a CLI plug-in file that begins with `oc-` or `kubectl-`.
.Procedure
. If necessary, update the plug-in file to be executable.
+
[source,terminal]
----
$ chmod +x <plugin_file>
----
. Place the file anywhere in your `PATH`, such as `/usr/local/bin/`.
+
[source,terminal]
----
$ sudo mv <plugin_file> /usr/local/bin/.
----
. Run `oc plugin list` to make sure that the plug-in is listed.
+
[source,terminal]
----
$ oc plugin list
----
+
.Example output
[source,terminal]
----
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-`
or `kubectl-`, is executable, and is on your `PATH`.
. 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
link:https://github.com/kubernetes/sample-cli-plugin[Sample plug-in repository],
you can use the following command to view the current namespace.
+
[source,terminal]
----
$ 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 the `oc foo bar`
command.