Skip to main content

Channels CLI Commands

Manage channels in your EventCatalog from the command line.

getChannel​

Returns a channel from EventCatalog by its ID

Arguments:

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

Examples:

# Get the latest channel
npx @eventcatalog/sdk getChannel "orders.events"

# Get a specific version
npx @eventcatalog/sdk getChannel "orders.events" "1.0.0"

getChannels​

Returns all channels from EventCatalog

Arguments:

NameTypeRequiredDescription
optionsjsonNoOptions: {latestOnly?}

Examples:

# Get all channels
npx @eventcatalog/sdk getChannels

writeChannel​

Writes a channel to EventCatalog

Arguments:

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

rmChannel​

Removes a channel by its path

Arguments:

NameTypeRequiredDescription
pathstringYesPath to the channel

Examples:

# Remove a channel
npx @eventcatalog/sdk rmChannel "/orders.events"

rmChannelById​

Removes a channel by its ID

Arguments:

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

Examples:

# Remove a channel
npx @eventcatalog/sdk rmChannelById "orders.events"

versionChannel​

Moves the current channel to a versioned directory

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the channel to version

Examples:

# Version a channel
npx @eventcatalog/sdk versionChannel "orders.events"

addEventToChannel​

Adds an event to a channel

Arguments:

NameTypeRequiredDescription
channelIdstringYesThe ID of the channel
eventjsonYesEvent reference: {id, version, parameters?}

addCommandToChannel​

Adds a command to a channel

Arguments:

NameTypeRequiredDescription
channelIdstringYesThe ID of the channel
commandjsonYesCommand reference: {id, version, parameters?}

addQueryToChannel​

Adds a query to a channel

Arguments:

NameTypeRequiredDescription
channelIdstringYesThe ID of the channel
queryjsonYesQuery reference: {id, version, parameters?}

channelHasVersion​

Checks if a specific version of a channel exists

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the channel
versionstringYesVersion to check

Examples:

# Check if version exists
npx @eventcatalog/sdk channelHasVersion "orders.events" "1.0.0"