Queries CLI Commands
Manage queries in your EventCatalog from the command line.
getQuery​
Returns a query from EventCatalog by its ID
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the query to retrieve |
| version | string | No | Specific version to retrieve |
Examples:
# Get the latest query
npx @eventcatalog/sdk getQuery "GetOrder"
# Get a specific version
npx @eventcatalog/sdk getQuery "GetOrder" "1.0.0"
getQueries​
Returns all queries from EventCatalog
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| options | json | No | Options: {latestOnly?, attachSchema?} |
Examples:
# Get all queries
npx @eventcatalog/sdk getQueries
writeQuery​
Writes a query to EventCatalog
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| query | json | Yes | Query object with id, name, version, and markdown |
| options | json | No | Options: {path?, override?, versionExistingContent?} |
writeQueryToService​
Writes a query to a specific service
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| query | json | Yes | Query object |
| service | json | Yes | Service reference: {id, version?} |
| options | json | No | Options: {path?, format?, override?} |