As a modest unofficial contribution, I would summarize the following possible use-cases (A) and (B) below for successfully using ZOWE-CLI on FreeBSD 13.2:
Use Case (A) : without @zowe/secrets-for-zowe-sdk
This works without X11 (absolutely no GUI), that is, on a really minimal FreeBSD installation. 
Getting Started:
# pkg install node npm
# npm -g install @zowe/cli@zowe-v2-lts
# chmod 755 /usr/local/lib/node_modules/@zowe/cli/lib/main.js
# mkdir ~/mydir
# cd ~/mydir
# zowe config init --user-config
# chmod 600 ~/mydir/zowe.config.user.json
On this scenario it’s necessary to turn off (set to false
) the autoStore
property on zowe.config.user.json
and doing so will cause the z/OS credentials being prompted on each command issued to the mainframe, unless the user
and password
properties are also declared in clear (which may not be an issue after all if you are the sole user of a reasonably hardened and minimalist virtual-machine dedicated to ZOWE) as follows:
box:~/mydir
# cat zowe.config.user.json
{
"$schema": "./zowe.schema.json",
"profiles": {
"zosmf": {
"type": "zosmf",
"properties": {
"host": "XXX.XXX.XXX.XXX",
"port": 10443,
"rejectUnauthorized": false,
"protocol": "https",
"user": "ZXXXXX",
"password": "XXXXXXXX"
},
"secure": []
}
},
"defaults": {
"zosmf": "zosmf"
},
"autoStore": false
}
At this point you shall be good to go.
Use Case (B) : with @zowe/secrets-for-zowe-sdk.
This only works if X11 is running as a D-Bus session seems absolutely required one way or the other for a keyring
where the z/OS credentials are kept encrypted. Perhaps this would be best suited for a shared FreeBSD desktop. Nevertheless, I’ve been successful with it on my minimal FreeBSD desktop which is just running Twm (no desktop manager at all), plus a few other tools and conveniences (an ungoogled-chrome, zathura/mupdf and so on); that’s all I really need.
Getting Started:
# pkg install node npm rust cargo-generate pkgconf libsecret gnome-keyring
# npm -g install @zowe/cli@zowe-v2-lts
# npm -g install @napi-rs/cli
# npm -g install @zowe/secrets-for-zowe-sdk
# chmod 755 /usr/local/lib/node_modules/@zowe/cli/lib/main.js
# mkdir ~/mydir
# cd ~/mydir
# zowe config init --user-config
# chmod 600 ~/mydir/zowe.config.user.json
Perhaps more conveniently, before the first use of ZOWE-CLI, check that the initial ~/mydir/zowe.config.user.json
is as follows:
box:~/mydir
# cat zowe.config.user.json
{
"$schema": "./zowe.schema.json",
"profiles": {
"zosmf": {
"type": "zosmf",
"properties": {
"host": "XXX.XXX.XXX.XXX",
"port": 10443,
"rejectUnauthorized": false,
"protocol": "https"
},
"secure": []
}
},
"defaults": {
"zosmf": "zosmf"
},
"autoStore": true
}
If you’re on a GUI session, just issue a ZOWE-CLI command such as
zowe zos-files list data-set “ZXXXXX.*”
and, while being prompted for z/OS credentials, a dialog box will appear (once in the session) asking for the encrypting password for a keyring
(where the z/OS credentials will be stored). If you’re running on a private machine, a “blank password” (that is, no password) for the keyring
may not be an issue (and may save you the annoyance of having to reenter it at each new GUI session). In case you’re under an SSH session, judging by being successful so far, I believe that the documented (Configuring Secure Credential Store on headless Linux operating systems | Zowe Docs) headless access should also work fine (although I haven’t had the need to verify this yet).
I hope to have mentioned every detail.
That’s it, good luck.
I wish to thank for all the help from @Trae Yelovich along the way and without which I would probably not succeed.
