This topic explains how to perform common operations with the om CLI, a tool that helps you configure and deploy tiles to VMware Tanzu Operations Manager without using the Tanzu Operations Manager UI. The om 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 om 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 om CLI, see om in GitHub.
You can install the om 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 om CLI. You must first have Homebrew installed to use this method.
To install the om CLI using Homebrew:
Download the om 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 om CLI directly from the om CLI GitHub repo.
To install the om CLI from direct download:
Go to the 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 needed and run the executable file.
Wait for your machine to prompt 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 om 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 username 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 successful, see product output. For 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 om CLI commands, see Commands in the om CLI GitHub documentation.