Skip to content

Latest commit

 

History

History
66 lines (57 loc) · 2.05 KB

cli-extending-plugins-installing.adoc

File metadata and controls

66 lines (57 loc) · 2.05 KB

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.

Prerequisites
  • You must have the oc CLI tool installed.

  • You must have a CLI plug-in file that begins with oc- or kubectl-.

Procedure
  1. If necessary, update the plug-in file to be executable.

    $ chmod +x <plugin_file>
  2. Place the file anywhere in your PATH, such as /usr/local/bin/.

    $ sudo mv <plugin_file> /usr/local/bin/.
  3. 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- or kubectl-, is executable, and is on your PATH.

  4. 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 the oc foo bar command.