6 Ways to Share Zowe CLI Scripts with Friends (and Coworkers 😃)

Dan Kelosky
Zowe
Published in
4 min readJan 28, 2023

--

Good friends share; great friends share Zowe CLI scripts.

— Anonymous

{Core} You can do a lot with Open Mainframe Project’s Zowe CLI, such as automating mainframe actions or integrating mainframe operations with some new tooling. However, many of us that build something new using Zowe CLI struggle finding ways to share what we’ve built with others.

Below are 6 ways that you can share custom Zowe CLI-based automation and tooling with others.

#1 Blog your code snippets

One option is to share code snippets and ideas in a blog. From there, your readers can customize and tailor the code snippets for similar, but non-exact scenarios after understanding the concepts that you explain.

Example blog intro image

This has a benefit of reaching many folks, but requires a significant time investment for others to actually make their own use following your pattern.

#2 Create a repo

A second option is the to create a public or internal repository for script samples that accomplish some mainframe use case:

Example repo for others to copy and customize

This is a bit faster to use than blogging samples; however, it still requires a time investment to customize someone else’s unfamiliar automation.

#3 Creating a wrapper CLI

You can encapsulate some sharable logic in a custom CLI that invokes Zowe CLI commands or uses the Zowe SDKs:

Custom CLI `api-dev` that invokes Zowe CLI behind the scenes

This takes more work up front to genericize some actions and people you share it with can use it quickly. The downside is that you might be expected to help troubleshoot when things don’t go quite right.

#4 Create a Zowe CLI plugin

As an alternative to creating a custom CLI, you can write a plugin to Zowe CLI itself that can add new commands groups under the primary zowe command!

Sample Zowe CLI plugin that can be tailored for other purposes

This is similar to the a custom CLI with an arguably more consistent end-user experience, but you will have to have a deeper understanding of Zowe CLI and its framework internals.

#5 Host parameterized scripts in Jenkins (or other) pipeline

You can place several Zowe CLI commands in a script file, invoke them with npm run …, and ultimately execute them from some shared [optionally parameterized] instance of Jenkins (or other CI tool):

Pipeline invoked by multiple users to deploy REXX code

With this, people can use your CI automation without installing software on their own machines but there likely won’t be a lot of flexibility on what this automation will do. It’s probably going to be limited to CI/CD use cases.

#6 Creating a server

Lastly, you can bundle Zowe CLI scripts or Zowe SDK calls into a web service that is callable from a UI or a CLI like cURL so that others can use your custom tooling from a centralized location:

Web app that invokes Zowe SDK methos and is called from cURL or a UI

This is perhaps the hardest to develop and manage but ultimately the easiest for others to adopt since users of your custom automation likely won’t need to install any software to use you scripts.

Summary

If you build something cool with Zowe CLI, please share, regardless of the format!

Learn more:

If you enjoyed this blog check out more Zowe blogs here. Or, ask a question and join the conversation on the Open Mainframe Project Slack Channel #zowe-api, #zowe-explorer-intellij, #zowe-explorer, #zowe-cli, #zowe-dev, #zowe-user, or #zowe-onboarding. If this is your first time using the Open Mainframe Slack Channel register here.

--

--

Dan Kelosky
Zowe

Likes programming/automation in mainframe (assembler, C/C++), distributed (Node.js), and web development (Firebase, Angular).