Copy as Markdown[View as Markdown](/docs/cli/cli-messages.md)

***

# Messages CLI Commands

Manage messages in your EventCatalog from the command line.

## getProducersAndConsumersForMessage[​](#getproducersandconsumersformessage "Direct link to getProducersAndConsumersForMessage")

Returns the producers and consumers (services) for a given message

**Arguments:**

| Name    | Type   | Required | Description           |
| ------- | ------ | -------- | --------------------- |
| id      | string | Yes      | The ID of the message |
| version | string | No       | Specific version      |

***

## getConsumersOfSchema[​](#getconsumersofschema "Direct link to getConsumersOfSchema")

Returns services that consume a given schema

**Arguments:**

| Name       | Type   | Required | Description             |
| ---------- | ------ | -------- | ----------------------- |
| schemaPath | string | Yes      | Path to the schema file |

***

## getProducersOfSchema[​](#getproducersofschema "Direct link to getProducersOfSchema")

Returns services that produce a given schema

**Arguments:**

| Name       | Type   | Required | Description             |
| ---------- | ------ | -------- | ----------------------- |
| schemaPath | string | Yes      | Path to the schema file |

***

## getOwnersForResource[​](#getownersforresource "Direct link to getOwnersForResource")

Returns the owners (users/teams) for a given resource

**Arguments:**

| Name    | Type   | Required | Description            |
| ------- | ------ | -------- | ---------------------- |
| id      | string | Yes      | The ID of the resource |
| version | string | No       | Specific version       |

**Examples:**

```
# Get owners for a resource
npx @eventcatalog/cli getOwnersForResource "OrderService"
```

***
