Skip to main content

Domains CLI Commands

Manage domains in your EventCatalog from the command line.

getDomain​

Returns a domain from EventCatalog by its ID

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the domain to retrieve
versionstringNoSpecific version to retrieve

Examples:

# Get the latest domain
npx @eventcatalog/sdk getDomain "Orders"

# Get a specific version
npx @eventcatalog/sdk getDomain "Orders" "1.0.0"

getDomains​

Returns all domains from EventCatalog

Arguments:

NameTypeRequiredDescription
optionsjsonNoOptions: {latestOnly?}

Examples:

# Get all domains
npx @eventcatalog/sdk getDomains

writeDomain​

Writes a domain to EventCatalog

Arguments:

NameTypeRequiredDescription
domainjsonYesDomain object with id, name, version, and markdown
optionsjsonNoOptions: {path?, override?, versionExistingContent?}

rmDomain​

Removes a domain by its path

Arguments:

NameTypeRequiredDescription
pathstringYesPath to the domain

Examples:

# Remove a domain
npx @eventcatalog/sdk rmDomain "/Orders"

rmDomainById​

Removes a domain by its ID

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the domain to remove
versionstringNoSpecific version to remove

Examples:

# Remove a domain
npx @eventcatalog/sdk rmDomainById "Orders"

versionDomain​

Moves the current domain to a versioned directory

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the domain to version

Examples:

# Version a domain
npx @eventcatalog/sdk versionDomain "Orders"

addFileToDomain​

Adds a file to a domain

Arguments:

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

addServiceToDomain​

Adds a service to a domain

Arguments:

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

addSubDomainToDomain​

Adds a subdomain to a domain

Arguments:

NameTypeRequiredDescription
domainIdstringYesThe ID of the parent domain
subDomainjsonYesSubdomain reference: {id, version}
domainVersionstringNoSpecific domain version

addEntityToDomain​

Adds an entity to a domain

Arguments:

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

addEventToDomain​

Adds an event relationship to a domain

Arguments:

NameTypeRequiredDescription
domainIdstringYesThe ID of the domain
directionstringYesDirection: "sends" or "receives"
eventjsonYesEvent reference: {id, version}
domainVersionstringNoSpecific domain version

addCommandToDomain​

Adds a command relationship to a domain

Arguments:

NameTypeRequiredDescription
domainIdstringYesThe ID of the domain
directionstringYesDirection: "sends" or "receives"
commandjsonYesCommand reference: {id, version}
domainVersionstringNoSpecific domain version

addQueryToDomain​

Adds a query relationship to a domain

Arguments:

NameTypeRequiredDescription
domainIdstringYesThe ID of the domain
directionstringYesDirection: "sends" or "receives"
queryjsonYesQuery reference: {id, version}
domainVersionstringNoSpecific domain version

addUbiquitousLanguageToDomain​

Adds ubiquitous language definitions to a domain

Arguments:

NameTypeRequiredDescription
domainIdstringYesThe ID of the domain
dictionaryjsonYesArray of {term, definition} objects
domainVersionstringNoSpecific domain version

getUbiquitousLanguageFromDomain​

Gets ubiquitous language definitions from a domain

Arguments:

NameTypeRequiredDescription
domainIdstringYesThe ID of the domain
domainVersionstringNoSpecific domain version

Examples:

# Get ubiquitous language
npx @eventcatalog/sdk getUbiquitousLanguageFromDomain "Orders"

domainHasVersion​

Checks if a specific version of a domain exists

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the domain
versionstringYesVersion to check

Examples:

# Check if version exists
npx @eventcatalog/sdk domainHasVersion "Orders" "1.0.0"