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.

Install the om CLI

You can install the om CLI in one of the following ways:

Install the om CLI using Homebrew

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:

  1. Download the om 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 om CLI from direct download

You can install the om CLI directly from the om CLI GitHub repo.

To install the om CLI from direct download:

  1. Go to the 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 needed and run the executable file.

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

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

Authenticate with the om 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 om 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 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.
  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 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 |                  |                  |
    +----------------------+---------------+------------------+------------------+
    

om CLI commands

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

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