Domains CLI Commands
Manage domains in your EventCatalog from the command line.
getDomain​
Returns a domain from EventCatalog by its ID
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the domain to retrieve |
| version | string | No | Specific 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:
| Name | Type | Required | Description |
|---|---|---|---|
| options | json | No | Options: {latestOnly?} |
Examples:
# Get all domains
npx @eventcatalog/sdk getDomains
writeDomain​
Writes a domain to EventCatalog
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domain | json | Yes | Domain object with id, name, version, and markdown |
| options | json | No | Options: {path?, override?, versionExistingContent?} |
rmDomain​
Removes a domain by its path
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | Path to the domain |
Examples:
# Remove a domain
npx @eventcatalog/sdk rmDomain "/Orders"
rmDomainById​
Removes a domain by its ID
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the domain to remove |
| version | string | No | Specific version to remove |
Examples:
# Remove a domain
npx @eventcatalog/sdk rmDomainById "Orders"
versionDomain​
Moves the current domain to a versioned directory
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the domain to version |
Examples:
# Version a domain
npx @eventcatalog/sdk versionDomain "Orders"
addFileToDomain​
Adds a file to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the domain |
| file | json | Yes | File object: {content, fileName} |
| version | string | No | Specific version |
addServiceToDomain​
Adds a service to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the domain |
| service | json | Yes | Service reference: {id, version} |
| domainVersion | string | No | Specific domain version |
addSubDomainToDomain​
Adds a subdomain to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the parent domain |
| subDomain | json | Yes | Subdomain reference: {id, version} |
| domainVersion | string | No | Specific domain version |
addEntityToDomain​
Adds an entity to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the domain |
| entity | json | Yes | Entity reference: {id, version} |
| domainVersion | string | No | Specific domain version |
addEventToDomain​
Adds an event relationship to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the domain |
| direction | string | Yes | Direction: "sends" or "receives" |
| event | json | Yes | Event reference: {id, version} |
| domainVersion | string | No | Specific domain version |
addCommandToDomain​
Adds a command relationship to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the domain |
| direction | string | Yes | Direction: "sends" or "receives" |
| command | json | Yes | Command reference: {id, version} |
| domainVersion | string | No | Specific domain version |
addQueryToDomain​
Adds a query relationship to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the domain |
| direction | string | Yes | Direction: "sends" or "receives" |
| query | json | Yes | Query reference: {id, version} |
| domainVersion | string | No | Specific domain version |
addUbiquitousLanguageToDomain​
Adds ubiquitous language definitions to a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the domain |
| dictionary | json | Yes | Array of {term, definition} objects |
| domainVersion | string | No | Specific domain version |
getUbiquitousLanguageFromDomain​
Gets ubiquitous language definitions from a domain
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| domainId | string | Yes | The ID of the domain |
| domainVersion | string | No | Specific domain version |
Examples:
# Get ubiquitous language
npx @eventcatalog/sdk getUbiquitousLanguageFromDomain "Orders"
domainHasVersion​
Checks if a specific version of a domain exists
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the domain |
| version | string | Yes | Version to check |
Examples:
# Check if version exists
npx @eventcatalog/sdk domainHasVersion "Orders" "1.0.0"