Content Hub command line interface (CLI)
The Content Hub command line interface (CLI) is a versatile tool that allows you to efficiently manage content and media within a Sitecore Content Hub instance, directly from the command line. It leverages the Web Client SDK to communicate with your Content Hub instances via the REST API. With the CLI, you can:
-
Serialize and deserialize content, for a seamless transfer of data between different Content Hub instances.
-
Automate Content Hub processes.
-
Integrate with external platforms and systems.
The Content Hub CLI is compatible with various operating systems, including Linux, Windows, and macOS, meaning you can use it with confidence, regardless of your system. Content Hub provides scripts, triggers, APIs, SDKs, and connectors that you can use to integrate with external platforms.
We recommend you avoid using the CLI for for migrating structural changes. Pages and components must be created in a specific order, which is hard to manage via CLI, and some updates require elevated rights that CLI does not support. Use the package import/export feature instead.
Configurations
All CLI-related configurations are stored in the .ch-cli subdirectory of the current user's directory at the path specified in the following table, depending on the operating system.
Operating system |
Path |
---|---|
Windows |
|
Linux/macOS |
|
Docker |
|
After you've installed the CLI, you can log into it using your client credentials.
For the best developer experience, we recommend you use the Visual Studio Code editor.