hzn command is the Open Horizon command line interface. When you install the Open Horizon agent software on an edge node, the
hzn CLI is automatically installed. But you can also install the
hzn CLI without the agent. For example, an edge administrator might want to query the Open Horizon exchange or an edge developer might want to test with
hzn commands, without the full agent.
Get the agentInstallFiles-<edge-device-type>.tar.gz file from your management hub administrator, where <edge-device-type> matches the host where you installing
hzn. They were already created in Gather the necessary information and files for edge devices. Copy this file to the host where you are installing hzn.
Set the file name in an environment variable for subsequent steps:
horizon_clipackage from the
tar -zxvf $AGENT_TAR_FILE 'horizon-cli*'
Confirm that the package version is the same as the device agent listed in Components.
On a debian-based distro:
sudo apt update && sudo apt install ./horizon-cli*.deb
On a RPM-based distro:
sudo yum install ./horizon-cli*.rpm
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain horizon-cli.crt sudo installer -pkg horizon-cli-*.pkg -target / pkgutil --pkg-info com.github.open-horizon.pkg.horizon-cli # confirm version installed
Note: On macOS, you can also install the horizon-cli pkg file from Finder: Double-click the file to open the installer. If you get an error message that says the program “cannot be opened because it is from an unidentified developer,” right-click the file and select Open. Click Open again when prompted “Are you sure you want to open it?”. Then, follow the prompts to install the CLI horizon package, ensuring your ID has administrator privileges.
If you want to remove the
horizon-cli package from a host:
horizon-clifrom a debian-based distro:
sudo apt-get remove horizon-cli
horizon-clifrom an RPM-based distro:
sudo yum remove horizon-cli