Content Hub Tip #32: How can you add a tenant to Content Hub ONE CLI?

 

Content Hub Logo

We all know the frustration of getting a new tool and you get stuck after installing it. Not knowing what is expected of you. Today, I installed the Content Hub ONE CLI. The first thing you need to do is add a tenant to interact with. So I tried some commands and found the following.

ch-one-cli tenant add --help

The documentation of the CLI states that you need to run the following command:
ch-one-cli tenant add --organization-id <Organization ID> --tenant-id <Tenant ID> --client-id <OAuth client ID> --client-secret <OAuth client secret>

What it doesn't tell you is where to get these values. So let me clear the "fog" for you.

Organization ID
See the updated version below to get the Organization ID.

You can find this value on the Sitecore Cloud Portal. It's the name of your Organization next to the Sitecore logo at the top of the page.

Organization ID in the Sitecore Cloud Portal

Tenant ID
See the updated version below to get the Tenant ID.

This ID you can find also via the  Sitecore Cloud Portal. Find your Content Hub ONE instance on the portal and click to navigate to the instance. In the URL bar of your browser, you'll find the following URL: https://content.sitecorecloud.io/?tenantName=[tenantid]

Use the bold highlighted value for your Tenant ID

Client ID and Client Secret

You can easily get these values from the Content Hub ONE. In Content Hub ONE, navigate to Settings and then OAuth Client. Use the Copy-icon at the end of the input box to copy the value.

Content Hub ONE - OAuth Clients page

The only left is to fill in the values in the command and execute it! When done correctly, you should get the following message.

Add Content Hub ONE tenant to CLI

You're now ready to start working with the Content Hub ONE CLI.

Until next time!

[Update]

You can find your Organization ID and Tenant ID in Content Hub ONE. Follow these steps:

  1. Click on your Avatar in the top right corner
  2. Click on your organization. You should see something similar like this:

    Organization and Tenant information
Thank you for the improvement Christos Papoutsakis!