Skip to content

Overview

The cms command interfaces with the TCG Collector API. It's the command-line content management system (CMS) of TCG Collector. In order to use any of these commands, an API configuration file is needed. Specific API or administrator privileges are required to use the CMS.

API configuration file

This JSON file contains the configuration needed to access the TCG Collector API.

Property Type Is required Description
baseUrl string Yes e.g., https://www.tcgcollector.com/api/.
accessToken string Yes

All cms-related commands automatically look for the TCGCOLLECTOR_API_CONFIG_FILE_PATH environment variable, which is used to refer to the API configuration file. If no such environment variable is set, the --api-config-file-path option must be used instead.

Managing resources

A lot of resources have an optional ID property. This ID property can be used to map resources to an external database. In the context of the CMS, it's used to map resources to the TCG Collector database. For interoperability, the ID property is always interpreted as a string value.

Exporting resources

When exporting resources using the cms export command, the ID property will be included automatically.

Creating resources

When creating resources using the cms create command, the ID property will be added automatically once the resource is created. Resources that have their ID property already set will be ignored.

Updating resources

When updating resources using the cms update command, resources that don't have the ID property set will be ignored.