This topic provides information about how to install and configure Sitecore Content Hub
Depending on the installation method or operation system,
ch-cli in the following examples might need to be replaced with one of the following:
- macOS or Linux:
docker run --rm -it -v ch-cli-data:/root/.ch-cli scr.sitecore.com/sch/ch-cli
--help option is available on all levels and helps you to explore the available commands or options.
Get an overview of the available commands and options on the root level:
Narrow down the help output to the
ch-cli endpoint --help
To interact with your Sitecore Content Hub instance, you need to log in first.
After you execute the login command, you are redirected to the specified Sitecore Content Hub instance and, once logged in, can grant permissions to the client. Available commands include:
ch-cli endpoint add --name <name> --url https://your.content.hub.url/ --client-id <OAuth client ID> --client-secret <OAuth client secret>
The redirect URL of the OAuth client and the one in the CLI need to be an exact match. The default is
http://localhost:9000/, but can be overridden using the
ch-cli endpoint add --name <name> --url https://your.content.hub.url/ --client-id <OAuth client ID> --client-secret <OAuth client secret> --redirect-uri http://localhost:9123/
Once executed, you are redirected to the specified Sitecore Content Hub instance to grant permissions to the client. If you accept, you are logged in and can start executing commands, otherwise not.
name- is a unique identifier that allows you to manage multiple connections to different instances (for example, staging and production or entirely different projects/customers).
url- is the base URL to your instance.
client-id- the OAuth client ID that you want to use for the authentication flow.
client-secret- the client secret for the specified OAuth client.
redirect-uri- allows to override the redirect URL to complete the authorization (optional).
All CLI related configuration is stored in JSON files in the
.ch-cli directory, in the current user's directory: