Skip to main content

Creating commands

Adding a command to your EventCatalog is a great way for you to document your messages.

What do commands look like in EventCatalog?​

Example

Adding a new command​

To add a new command create a new folder within the /commands folder with an index.md file.

  • /commands/{Command Name}/index.md
    • (example /commands/UpdateInventory/index.md)

The index.md contents are split into two sections, frontmatter and the markdown content.

Here is an example of what a domain markdown file may look like.

/commands/UpdateInventory/index.md (example)
---
# id of your command, used for slugs and references in EventCatalog.
id: Orders

# 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 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 />

That's it!

Once you add your new command to EventCatalog, it will now show in the docs, visualizer and discoverability table.

Adding content​

With commands you can write any Markdown you want and it will render on your page. Every command gets its own page.

Within your markdown content you can use components to add interactive components to your page.

Tips for command content​

It's entirely up to you what you want to add to your commands markdown content but here are a few things you might want to consider.

  • Context of the command. What is it? Why does it exist?
  • How can others trigger this command?
  • What is the schema of command?
  • How can others make contributions to changes to this command? Who do they contact (owners?)
  • Any edit/contributing guidelines?