Command frontmatter API
Overview​
Commands are just markdown files, with this comes the use of Content, MDX components and also front-matter.
Here is an example of the command frontmatter you will find in your /commands
folder.
/commands/UpdateInventory/index.md (example)
---
# id of your command, used for slugs and references in EventCatalog.
id: UpdateInventory
# Display name of the command, rendered in EventCatalog
name: Update inventory
# Version of the command
version: 0.0.3
# Short summary of your command
summary: |
Command with the intent to update the inventory
# Optional owners, references teams or users
owners:
- dboyne
# Optional details about the programming language and url for the code
repository:
language: JavaScript
url: https://github.com/event-catalog/pretend-shipping-service
# Optional badges, rendered to UI by EventCatalog
badges:
- content: New service
backgroundColor: blue
textColor: blue
---
## Overview
The `Update Inventory` command represents intent to update the inventory of a given item over HTTP.
<NodeGraph />
Required fields​
id
​
- Type:
string
Unqiue id of the command. EventCatalog uses this for references and slugs.
Example
---
id: UpdateInventory
---
name
​
- Type:
string
Name of the command this is used to display the name on the UI.
Example
---
name: Update Inventory
---
version
​
- Type:
string
Version of the command.
Example
---
version: 0.0.1
---
Optional fields​
summary
​
Short summary of your command, shown on command summary pages.
Example
---
summary: |
Command that updated the inventory over HTTP.
---
owners
​
An array of user ids that own the command.
Example
---
owners:
- dboyne
- mSmith
---
badges
​
An array of badges that get rendered on the page.
Example
---
badges:
- content: My badge
backgroundColor: blue
textColor: blue
---
specifications
​
Added in
eventcatalog@2.6.0
Specifications to include on the page
Current supports AsyncAPI and OpenAPI files. When including the specifications the page will render badges and buttons for the specifications.
Example
---
specifications:
asyncapiPath: order-service-asyncapi.yaml
openapiPath: openapi.yml
---
repository
​
Added in
eventcatalog@2.11.2
Repository language and code url for the command.
Example
---
repository:
language: JavaScript
url: https://github.com/event-catalog/pretend-shipping-service
---