Formatting Output

FormatExpressions

--format=<FormatExpression>
--format= "<json|table|csv>[(<List of Properties>)]"

The --format option can be used to control the output style of the items returned from the command.

A FormatExpression consists of a Format following by a list of Properties in parentheses. The Format corresponds to the general visual format of the returned items. The list of Properties determines which attributes are returned for each item.

Valid Formats:

FormatDescription
json [default]Items are returned as objects in a formatted JSON array with either the properties specified in the FormatExpression or the default properties for the returned entity type.
tableItems are returned as rows in an ASCII-formatted table that will conform to the width of the console with either the properties specified in the FormatExpression or the default properties for the returned entity type.
csvItems are returned as rows in a valid CSV output, with properties as the header row

Examples

To output Instances in JSON format with the Name, Id, and Status attributes:

$ catalytic instance list --format="json(Name,Id,Status)"

{
  "items": [
    {
      "Name": "ROI Calculation",
      "Id": "4181bd8f-e364-4b16-851c-2b5230613d84",
      "Status": "Completed"
    },
    {
      "Name": "Execute Database Change",
      "Id": "39cb8217-9ae8-440d-b96c-7b056b7e7b99",
      "Status": "Running"
    },
    {
      "Name": "Update Sales Target",
      "Id": "79c976d9-86fc-49d7-a0ec-b4bb193d67a4",
      "Status": "Cancelled"
    }
  ]
}

To output Workflows in Table format with the default properties:

$ catalytic workflow list --format=table


 #  |                 Id                 |            Name            |  TeamName  |            Description             |   Category    |         Owner         
----|------------------------------------|----------------------------|------------|------------------------------------|---------------|-----------------------
 1  |8582d803-3e46-41d6-bf76-651ad61315a4| Create Quarter Goal        | pied-piper | Create a new goal for the quarter  | general       | [email protected] 
 2  |daa33305-e1e3-45d9-975b-c3d8849781ab| Invoice Intake             | pied-piper | Process an incoming invoice        | finance       | [email protected]  
 3  |d12e803d-f8b7-4d8e-bdf6-20a1359e33a1| Employee Onboarding        | pied-piper | Onboard a new employee             | hr            | [email protected]   

To output Workflows in CSV format with the Name and Description properties:

$ catalytic workflow list --format=csv(Name,Description)

"Name","Description"
"Create Quarter Goal","Create a new goal for the quarter"
"Invoice Intake","Process an incoming invoice"
"Employee Onboarding","Onboard a new employee"