Developing for Zowe CLI (Active Development Version)

You can extend Zowe CLI by developing plug-ins and contributing code to the base Zowe CLI or existing plug-ins.

Note: The tutorials in this branch of documentation are specific to the Active Development version, or @latest CLI. For Stable instructions, see Stable Zowe CLI Development Tutorials. We recommend that you create both versions of your plug-in in separate branches.

How to contribute

  1. Add new commands, options, or other improvements to the base CLI.
  2. Develop a plug-in that users can install to Zowe CLI.

Benefits of contributing

  • Provide new scriptable functionality to yourself, your organization, or to a broader community.
  • Make use of Zowe CLI infrastructure (profiles and programmatic APIs).
  • Participate in the Zowe CLI community space.

Getting started

If you want to start working with code immediately, clone the zowe-cli-sample-plugin GitHub repository and extend it or follow our tutorials. The repository includes a sample plug-in that adheres to the project contribution guidleines. You can also check out the Zowe CLI core repository and the contribution guidelines.

Tutorials

Follow these tutorials to get started working with the sample plug-in:

  1. Setting up - Clone the project and prepare your local environment.
  2. Installing a plug-in - Install the sample plug-in to Zowe CLI and run as-is.
  3. Extending a plug-in - Extend the sample plug-in with a new by creating a programmatic API, definition, and handler.
  4. Creating a new plug-in - Create a new CLI plug-in that uses Zowe CLI programmatic APIs and a diff package to compare two data sets.
  5. Implementing user profiles - Implement user profiles with the plug-in.

Plug-in Development Overview

At a high level, a plug-in must have imperative-framework configuration (sample here). This configuration is discovered by imperative-framework through the package.json imperative key.

A Zowe CLI plug-in will minimally contain the following:

  1. Programmatic API - Node.js programmatic APIs to be called by your handler or other Node.js applications.
  2. Command definition - The syntax definition for your command.
  3. Handler implementation - To invoke your programmatic API to display information in the format that you defined in the definition.

The following guidelines and documentation will assist you during development:

Imperative CLI Framework Documentation

Imperative CLI Framework documentation is a key source of information to learn about the features of Imperative CLI Framework (the code framework that you use to build plug-ins for Zowe CLI). Refer to these supplementary documents during development to learn about specific features such as:

  • Auto-generated help
  • JSON responses
  • User profiles
  • Logging, progress bars, experimental commands, and more!

Contribution Guidelines

The Zowe CLI contribution guidelines contain standards and conventions for developing Zowe CLI plug-ins.

The guidelines contain critical information about working with the code, running/writing/maintaining automated tests, developing consistent syntax in your plug-in, and ensuring that your plug-in integrates with Zowe CLI properly:

For more information about ... See:
General guidelines that apply to contributing to Zowe CLI and Plug-ins Contribution Guidelines
Conventions and best practices for creating packages and plug-ins for Zowe CLI Package and Plug-in Guidelines
Guidelines for running tests on Zowe CLI Testing Guidelines
Guidelines for running tests on the plug-ins that you build Plug-in Testing Guidelines
Versioning conventions for Zowe CLI and Plug-ins Versioning Guidelines