Pull, push, compare and validate resources
Using serialization commands, you can pull, push, compare, and validate resources. You can then create and install a package.
In some of the examples in this section, the --name parameter has a value that includes a wildcard. Assigning wildcards to a parameter lets you target data based on a pattern instead of a literal value. For example, using the name value of MyNamespace* affects all resources with a name that starts with MyNamespace.
Pull
To fetch resources from the connected Content Hub instance, use the pull command. The working directory is initialized automatically when pulling resources for the first time.
You can specify what type of resource to fetch by appending parameters to the command, as shown in the following examples:
The id (for example, 34167) and the identifier (for example, asset.mae-mu-1421987) are separate system properties. Entity names are resolved based on the DisplayTemplate property of their respective entity definitions. If the DisplayTemplate property does not have a value, the entity identifier is used as the entity name. To resolve a name collision, append the entity identifier to its name.
Push
To push resources to the connected Content Hub instance, use the push command. You can specify what type of resource to push by appending parameters to the command, as shown in the following examples:
Compare
Use the diff command to examine resources available locally and those present in the Content Hub instance, and then highlight any differences. By default, the output shows a high-level overview of whether an entity was updated ([U]), added ([A]) or deleted ([D]). To see detailed changes, you can append the --verbose flag to the command.
To compare resources, run one of the following commands:
Validate
The CLI validates the YAML files to ensure, for example, that they use unique IDs, valid culture identifiers, and respect field length restrictions.
To validate resources locally, even while working on them, run one of the following commands: