Channels CLI Commands
Manage channels in your EventCatalog from the command line.
getChannel​
Returns a channel from EventCatalog by its ID
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the channel to retrieve |
| version | string | No | Specific 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:
| Name | Type | Required | Description |
|---|---|---|---|
| options | json | No | Options: {latestOnly?} |
Examples:
# Get all channels
npx @eventcatalog/sdk getChannels
writeChannel​
Writes a channel to EventCatalog
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| channel | json | Yes | Channel object with id, name, version, and markdown |
| options | json | No | Options: {path?, override?} |
rmChannel​
Removes a channel by its path
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | Path to the channel |
Examples:
# Remove a channel
npx @eventcatalog/sdk rmChannel "/orders.events"
rmChannelById​
Removes a channel by its ID
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the channel to remove |
| version | string | No | Specific version to remove |
Examples:
# Remove a channel
npx @eventcatalog/sdk rmChannelById "orders.events"
versionChannel​
Moves the current channel to a versioned directory
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the channel to version |
Examples:
# Version a channel
npx @eventcatalog/sdk versionChannel "orders.events"
addEventToChannel​
Adds an event to a channel
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| channelId | string | Yes | The ID of the channel |
| event | json | Yes | Event reference: {id, version, parameters?} |
addCommandToChannel​
Adds a command to a channel
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| channelId | string | Yes | The ID of the channel |
| command | json | Yes | Command reference: {id, version, parameters?} |
addQueryToChannel​
Adds a query to a channel
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| channelId | string | Yes | The ID of the channel |
| query | json | Yes | Query reference: {id, version, parameters?} |
channelHasVersion​
Checks if a specific version of a channel exists
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the channel |
| version | string | Yes | Version to check |
Examples:
# Check if version exists
npx @eventcatalog/sdk channelHasVersion "orders.events" "1.0.0"