Skip to main content

Data Products CLI Commands

Manage data products in your EventCatalog from the command line.

getDataProduct​

Returns a data product from EventCatalog by its ID

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data product to retrieve
versionstringNoSpecific version to retrieve

Examples:

# Get the latest data product
npx @eventcatalog/sdk getDataProduct "customer-360"

# Get a specific version
npx @eventcatalog/sdk getDataProduct "customer-360" "1.0.0"

getDataProducts​

Returns all data products from EventCatalog

Arguments:

NameTypeRequiredDescription
optionsjsonNoOptions: {latestOnly?}

Examples:

# Get all data products
npx @eventcatalog/sdk getDataProducts

writeDataProduct​

Writes a data product to EventCatalog

Arguments:

NameTypeRequiredDescription
optionsjsonNoOptions: {path?, override?, versionExistingContent?}

writeDataProductToDomain​

Writes a data product to a specific domain

Arguments:

NameTypeRequiredDescription
dataProductjsonYesData product object
domainjsonYesDomain reference: {id, version?}
optionsjsonNoOptions

rmDataProduct​

Removes a data product by its path

Arguments:

NameTypeRequiredDescription
pathstringYesPath to the data product

Examples:

# Remove a data product
npx @eventcatalog/sdk rmDataProduct "/customer-360"

rmDataProductById​

Removes a data product by its ID

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data product to remove
versionstringNoSpecific version to remove

Examples:

# Remove a data product
npx @eventcatalog/sdk rmDataProductById "customer-360"

versionDataProduct​

Moves the current data product to a versioned directory

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data product to version

Examples:

# Version a data product
npx @eventcatalog/sdk versionDataProduct "customer-360"

addFileToDataProduct​

Adds a file to a data product

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data product
filejsonYesFile object: {content, fileName}
versionstringNoSpecific version

addDataProductToDomain​

Adds a data product reference to a domain

Arguments:

NameTypeRequiredDescription
domainIdstringYesThe ID of the domain
dataProductjsonYesData product reference: {id, version}
domainVersionstringNoSpecific domain version

dataProductHasVersion​

Checks if a specific version of a data product exists

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data product
versionstringYesVersion to check