This topic explains how to perform common operations with the Tanzu Operations Manager CLI, a tool that helps you configure and deploy tiles to VMware Tanzu Operations Manager without using the Tanzu Operations Manager UI. The Tanzu Operations Manager CLI communicates with the Tanzu Operations Manager API.
In addition to using the om CLI directly, you can use it to manage Tanzu Operations Manager programmatically through platform automation. For information about platform automation, see the Platform Automation Toolkit.
The Tanzu Operations Manager CLI has the following benefits over the Tanzu Operations Manager API:
You can om curl
Tanzu Operations Manager API calls with easier authentication
om CLI commands are easier to use and memorize
om CLI output can be easier to parse
For more information about using the Tanzu Operations Manager CLI, see om in GitHub.
You can install the Tanzu Operations Manager CLI in one of the following ways:
Mac or Linux Users: Install om CLI using Homebrew
Windows, Mac, or Linux Users: Install om CLI from direct download
If you are on a Mac or Linux machine, you can use Homebrew to install the Tanzu Operations Manager CLI. You must first have Homebrew installed to use this method.
To install the Tanzu Operations Manager CLI using Homebrew:
Download the Tanzu Operations Manager CLI.
brew tap pivotal-cf/om https://github.com/pivotal-cf/om
Install the om CLI.
brew install om
Test your installation.
om version
You can install the Tanzu Operations Manager CLI directly from the om CLI GitHub repo.
To install the Tanzu Operations Manager CLI from direct download:
Go to om CLI releases in GitHub and choose your release.
Download the release from Assets. Choose the asset that corresponds with your operating system. For example, download om-windows-x.x.x.zip
for Windows machines.
Unzip your file, if necessary, and run the executable file.
Wait for your machine to indicate that the installation is complete.
Test your installation by opening a Shell window and running om version
.
For most om CLI commands, you must authenticate with Tanzu Operations Manager by putting your Tanzu Operations Manager login information into a YAML file.
To authenticate with the Tanzu Operations Manager CLI:
In your workspace, create a YAML file that represents your Tanzu Operations Manager environment. Give the file a name. For example:
touch om-cli-env.yml
Add the following content to the file. For more information about configuring the file, see Generating an Env File in the Platform Automation Toolkit documentation.
---
target: https://OPS-MANAGER-FQDN
username: OPS-MANAGER-USERNAME
password: OPS-MANAGER-PASSWORD
Where:
OPS-MANAGER-FQDN
is the FQDN of your Tanzu Operations Manager deployment.OPS-MANAGER-USERNAME
is the user name that you use when you log into the Tanzu Operations Manager UI.OPS-MANAGER-PASSWORD
is the password that you use when you log into the Tanzu Operations Manager UI.On your machine, set an environment variable to the absolute filepath of your environment file for easy access.
export OM_ENV=PATH-TO-WORKING-DIRECTORY/om-cli-env.yml
Test authentication in your Tanzu Operations Manager environment by running the om products
command.
om --env=$OM_ENV products
If this is successful, you will see product output that looks similar to this example:
+----------------------+---------------+------------------+------------------+ | NAME | AVAILABLE | STAGED | DEPLOYED | +----------------------+---------------+------------------+------------------+ | cf | 2.10.12 | 2.10.12 | 2.10.12 | | p-bosh | | 2.10.8-build.168 | 2.10.8-build.168 | | pivotal-telemetry-om | 1.1.2-build.2 | | | +----------------------+---------------+------------------+------------------+
For a list of all Tanzu Operations Manager CLI commands, see Commands in the om CLI GitHub documentation.