Getting Started with Zowe CLI

Sujay Solomon
Zowe
Published in
5 min readSep 16, 2019

Zowe CLI is for z/OS like the AWS CLI is for AWS. It’s a client-side CLI that allows access to all the infrastructure services on z/OS. Client-side CLIs allow you to script and automate on-platform actions from the comfort and choice of your client — Windows, Mac or Linux — anywhere you can run Node.js, you can run Zowe CLI.

Quick-Start Steps:

  1. Install Node.js and npm on your laptop if you don’t already have it. This is a pre-requisite for Zowe CLI, similar to how Java or C++ runtimes are pre-requisites for many other tools. If you can’t download Node.js and npm from npmjs.com, you may need to check your company’s techstack of approved software to acquire it from there.
  2. To install core Zowe CLI, from a terminal like command prompt or bash, issue npm install -g @zowe/cli . This will require you to have unrestricted internet access to npmjs.com as your npm command will access this online registry. Full details and alternate installation methods that don’t require access to npmjs.com are available on Zowe Docs.
  3. Once installed, validate that Zowe CLI is functioning properly from a terminal by issuing zowe --help . You should see the help text from Zowe CLI.
  4. Now install any CLI plugins you might need such as the CICS plugin by issuing this command from a terminal— zowe plugins install @zowe/cics@latest . The CICS plugin is hosted on public npm registry on npmjs.com. However, other third-party CLI plugins like CA Endevor may be hosted on other private registries. To install the CA Endevor plugin, you will need to configure your npm registry settings to npm config set @brightside:registry https://api.bintray.com/npm/ca/brightside . Now issue zowe plugins install @brightside/endevor@latest to install the latest CA Endevor plugin for Zowe CLI.
  5. Once all your desired commands are available on your machine, you may want to create profiles for the services you wish to use such as z/OS (z/OSMF), CA Endevor or CICS. Here’s documentation on Zowe’s Quick Start Guide on how to create a z/OSMF profile for all the basic z/OS commands to work. Keep in mind that you’ll need profiles for each service if you want to avoid keying in your service address and credentials in each command; you can also create multiple profiles for any service to connect to different LPARs easily. Your mainframe SAF userid must be authorized to access these services in order for the CLI commands to work. Read the Gaining Access to z/OS Services section below for more details on this.
  6. You’re now ready to start using Zowe CLI to remotely interact with numerous services on z/OS! Enjoy the freedom of client-side scripting and a world of integration possibilities.

Troubleshooting: If you don’t see the help text in response to the command, you may need to troubleshoot some of the steps. The Open Mainframe Project’s Slack space has plenty of folks who are eager to help new Zowe CLI users. Hop on there and find the #zowe-cli channel for help.

Ideas or Bugs: If you think you’ve found a bug with Zowe CLI or if you’ve got an idea to make the CLI better, open GitHub issues at the Zowe CLI GitHub repository.

Gaining Access to z/OS Services

If you are a mainframe user actively working on a project, it is possible that you already have some or all of the required access to API services on z/OS such as z/OSMF or CA Endevor. If you don’t already have access, use one of the templates below to request access from your system administrators.

z/OSMF

If you are just getting started with z/OSMF, use the template below to create a request for your system security administrator to grant you access to the z/OSMF APIs:

Hi, I <your_userid> need access to z/OSMF REST APIs on <system_name>.
More specifically, I need access to the files, jobs, tso and optionally the console
z/OSMF REST APIs.
This is for access to z/OSMF from the Zowe CLI.
You can use <other_userid> as a model ID.
The following security profiles are required: <profile_1, profile_2, profile_3>
Please set my maximum region size to 65536 KB as the APIs need it.
Thank you!

If you are the first one in the organization to use Zowe CLI with z/OSMF, it is best to set up time with your system administrator and introduce the command line interface and how you plan to use it. If your system administrator has not setup z/OSMF properly yet, you may want to forward information about z/OSMF configuration pre-requisites in Broadcom’s CA Brightside documentation. This may save you some troubleshooting time later on.

CA Endevor

After installing the Zowe CLI Endevor plugin, use the template below to create a request for your Endevor administrator to grant you access to the CA Endevor APIs:

Hi, I <your_userid> need access to CA Endevor REST APIs on <system_name>.
This is for access to CA Endevor from the Zowe CLI.
You can use <other_userid> as a model ID.
The following security profiles are required: <profile_1, profile_2, profile_3>
Thank you!

If your Endevor admin doesn’t have the Endevor Web Services setup, you may want to forward the Configure CA Endevor SCM for Web Services instructions.

Other Services

In addition to the core z/OSMF based commands, Zowe CLI also has plugins for the following services.

Public/Free:

  1. Zowe z/OS Make
  2. CA Endevor
  3. CA OPS/MVS
  4. CA File Master Plus
  5. IBM Db2
  6. IBM CICS
  7. IBM CICS Deploy
  8. IBM IMS
  9. IBM MQ
  10. IBM z/OS Connect

Private/Commercial:

  1. CA Secure Credential Store (client side encryption plugin, no specific z/OS API required)
  2. CA z/OS Extended Files
  3. CA z/OS Extended Jobs
  4. IBM Db2 DevOps Experience
  5. Phoenix (E)JES

A complete list of Zowe conformant plugins can be found on the Zowe Conformance page.

Most of the above services require their respective API Services to be configured on z/OS. Once configured, you will need to request that your SAF userid is provided access to these services in the same manner as the examples provided for z/OSMF and CA Endevor.

Scripting

The power of a client-side CLI is the ability to use your choice of scripting language to quickly create handy automation. Here’s a simple shell script from the Zowe CLI Getting Started doc page to give you a taste:

#!/bin/bash

set -e

# Obtain the list of temporary project data sets
dslist=$(zowe zos-files list dataset "my.project.ds*")

# Delete each data set in the list
IFS=$'\n'
for ds in $dslist
do
echo "Deleting Temporary Project Dataset: $ds"
zowe files delete ds "$ds" -f
done

Additionally, here’s Broadcom’s resources page for Zowe that provides links to more scripting samples.

--

--