The content-type command category includes a number of interactions with content types.
These commands can be used to retrieve information on one or more types, register new types or update existing ones, export and import types from an individual hub, as well as archiving and unarchiving types.
Before importing content types you must ensure that a valid content type schema exists in the destination hub for each type.
Run dc-cli content-type --help
to get a list of available commands.
Return to README.md for information on other command categories.
The following options are available for all content-type commands.
Option Name | Type | Description |
---|---|---|
--version | [boolean] | Show version number |
--clientId | [string] [required] |
Client ID for the source hub |
--clientSecret | [string] [required] |
Client secret for the source hub |
--hubId | [string] [required] |
Hub ID for the source hub |
--config | [string] [default: "~/.amplience/dc-cli-config.json"] |
Path to JSON config file |
--help | [boolean] | Show help |
--logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
Archives one or more content types. This hides them from the active content type list in the Dynamic Content UI and prevents new content items being created of that type.
dc-cli content-type archive [id]
Option Name | Type | Description |
---|---|---|
--schemaId | [string] | The Schema ID of a Content Type's Schema to be archived. A regex can be provided to select multiple types with similar or matching schema IDs (eg /.header..json/). A single --schemaId option may be given to match a single content type schema. Multiple --schemaId options may be given to match multiple content type schemas at the same time. |
--revertLog | [string] | Path to a log file containing content unarchived in a previous run of the unarchive command. When provided, archives all types listed as unarchived in the log file. |
-f --force |
[boolean] | If present, there will be no confirmation prompt before archiving the found content. |
-s --silent |
[boolean] | If present, no log file will be produced. |
--ignoreError | [boolean] | If present, unarchive requests that fail will not abort the process. |
--logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type archive
dc-cli content-type archive --schemaId "/Christmas/"
Exports content types from the targeted Dynamic Content hub into the specified filesystem location.
More details can be found in export usage.
dc-cli content-type export <dir>
Option Name | Type | Description |
---|---|---|
--schemaId | [string] | The Schema ID of a Content Type to be exported. If no --schemaId option is given, all content types for the hub are exported. A single --schemaId option may be given to export a single content type. Multiple --schemaId options may be given to export multiple content types at the same time. |
-f --force |
[boolean] | Overwrite content types without asking. |
--archived | [boolean] | If present, archived content types will also be considered. |
--logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type export ./myDirectory/type
dc-cli content-type export ./myDirectory/type --schemaId "/Christmas/"
Returns information for a single content type. Returns ID, URI, status, and settings.
dc-cli content-type get <id>
Option Name | Type | Description |
---|---|---|
--json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type get foo
Imports content types from the specified filesystem location to the targeted Dynamic Content hub.
Before importing content types you must ensure that a valid content type schema exists in the destination hub for each content type.
More details can be found in import usage.
dc-cli content-type import <dir>
Option Name | Type | Description |
---|---|---|
--sync | [boolean] [default: false] |
Automatically sync Content Type schema. |
--skipAssign | [boolean] [default: false] |
Skip assigning content types to repositories. |
--logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type import ./myDirectory/type
Returns information for a all content types in the target hub. Returns ID, label, and schema ID (URI).
dc-cli content-type list
Option Name | Type | Description |
---|---|---|
--sort | [string] | How to order the list e.g "<property>,<asc|desc>..." |
--json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type list
Registers a new content type with an existing content type schema in the targeted Dynamic Content hub. Allows you to specify custom cards and icons, as well as visualization URLs.
Before registering a content type you must ensure that a valid content type schema exists in the destination hub for this content type.
dc-cli content-type register
Option Name | Type | Description |
---|---|---|
--schemaId | [string] [required] |
The content type's schema ID |
--label | [string] [required] |
The content type's label |
--icons | [default: {}] | The content type's icons |
--visualizations | [default: {}] | The content type's visualizations |
--cards | [default: {}] | The content type's cards |
--json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type register --schemaId https://example.com/foo.json --label bar
dc-cli content-type register --schemaId https://example.com/foo.json --icons.0.size 256 --icons.0.url "https://example.com/bar.jpg"
dc-cli content-type register --schemaId https://example.com/foo.json --visualizations.0.label "bar" --visualizations.0.templatedUri "https://example.com/baz" --visualizations.0.default true
dc-cli content-type register --schemaId https://example.com/foo.json —-cards.0.label "bar" —-cards.0.templatedUri "https://schema.localhost.com/baz" —-cards.0.default true
Synchronises a content type, so that it matches the present version of its registered schema.
dc-cli content-type sync <id>
Option NameOption Name | TypeType | DescriptionDescription |
---|---|---|
--json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type sync foo
Unarchives one or more content types. This returns them to the active content type list in the Dynamic Content UI and allows new content items to be created of that type once more.
dc-cli content-type unarchive [id]
Option Name | Type | Description |
---|---|---|
--schemaId | [string] | The Schema ID of a Content Type's Schema to be unarchived. A regex can be provided to select multiple types with similar or matching schema IDs (eg /.header..json/). A single --schemaId option may be given to match a single content type schema. Multiple --schemaId options may be given to match multiple content type schemas at the same time. |
--revertLog | [string] | Path to a log file containing content archived in a previous run of the archive command. When provided, unarchives all types listed as archived in the log file. |
-f --force |
[boolean] | If present, there will be no confirmation prompt before unarchiving the found content. |
-s --silent |
[boolean] | If present, no log file will be produced. |
--ignoreError | [boolean] | If present, unarchive requests that fail will not abort the process. |
--logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type unarchive
dc-cli content-type unarchive --schemaId "/Christmas/"
Updates the supporting properties of the content type, including custom cards and icons, as well as visualization URLs.
dc-cli content-type update <id>
Option Name | Type | Description |
---|---|---|
--label | [string] [required] |
The content type's label |
--icons | [default: {}] | The content type's icons |
--visualizations | [default: {}] | The content type's visualizations |
--cards | [default: {}] | The content type's cards |
--json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type update foo --icons.0.size 256 --icons.0.url "https://example.com/bar.jpg"
dc-cli content-type update foo --visualizations.0.label "bar" --visualizations.0.templatedUri "https://example.com/baz" --visualizations.0.default true
dc-cli content-type update foo —-cards.0.label "bar" —-cards.0.templatedUri "https://schema.localhost.com/baz" —-cards.0.default true