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.

Install the Tanzu Operations Manager CLI

You can install the Tanzu Operations Manager CLI in one of the following ways:

Install the Tanzu Operations Manager CLI using Homebrew

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:

  1. Download the Tanzu Operations Manager CLI.

    brew tap pivotal-cf/om https://github.com/pivotal-cf/om
    
  2. Install the om CLI.

    brew install om
    
  3. Test your installation.

    om version
    

Install the Tanzu Operations Manager CLI from direct download

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:

  1. Go to om CLI releases in GitHub and choose your release.

  2. 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.

  3. Unzip your file, if necessary, and run the executable file.

  4. Wait for your machine to indicate that the installation is complete.

  5. Test your installation by opening a Shell window and running om version.

Authenticate with the Tanzu Operations Manager CLI

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:

  1. 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
    
  2. 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.
  3. 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
    
  4. 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 |                  |                  |
    +----------------------+---------------+------------------+------------------+
    

Tanzu Operations Manager CLI commands

For a list of all Tanzu Operations Manager CLI commands, see Commands in the om CLI GitHub documentation.

check-circle-line exclamation-circle-line close-line
Scroll to top icon