mzcli is a command line interface (CLI) that lets you execute system commands independently of which host environment mzcli is running on. Each operation is described in detail in sub chapters.
mzcli replaces many commands in the previous CLI (mzsh) in . Some commands are not supported by mzcli, for example shutdown, restart, start, and status. Commands not supported by mzcli are listed /wiki/spaces/UEPE3D/pages/1910988. For these commands you still have to use mzsh. The long-term plan is to remove mzsh.
mzcli is a java application that allows you to execute commands by calling platform Web APIs. mzcli has the following advantages over mzsh:
mzsh can only be executed in the platform. The new CLI does not have this limitation.
mzcli works fine on any computer with java that has HTTP connectivity to the platform.
If you are executing mzcli in the platform or execution context you can use the "mzcli" short command instead of "java -jar mzcli.jar".
If you are running 10 in a Kubernetes environment mzcli can also be executed using "kubectl". Example:
kubectl exec platform-0 -- bash -c "mzcli ..."
The options specified with double-dashes (--) can also be specified via environment variables: MZCLI_PORT, MZCLI_HOST, MZCLI_USER, MZCLI_PASSWORD, and MZCLI_SCHEMA. The environment variables need to be set for the machine that is running the mzcli client.
The options can also be specified via a property file called mzcli.properties with these property names and default values:
mzcli searches for this file in MZ_HOME/etc (if MZ_HOME exists) or in the local folder (if MZ_HOME does not exist). If the mzcli.properties file is not present, it is created with default values.
If an option is not specified, its default value is used.
A simplified user/password syntax can also be used. Just enter username and password in a single parameter together with the preferred command. When the command is executed, the command prompt is returned to the Unix shell.
Example - How to use simplified user/password syntax
Lower priority means that it can be overridden by anything with higher priority.
The priority is as follows, ranking lowest to highest:
Values from the mzcli.properties file
Options specified when out of interactive mode
Username and password specified using the[<username/password>] syntax
Options specified when in interactive mode
If a command produces output files mzcli saves them to disk. Use the -overwrite option to save a file to disk even if a file with the same name already exists. If the -overwrite option is not specified, and a file with the same file name exists, mzcli displays an error message and terminates without saving the file.