For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex XSOAR 6.xCortex XSOAR 8 (SaaS)Cortex XSOAR 8.x (On-premCortex XSIAM

generate-outputs

Generate integration context outputs from JSON responses or command examples.

Generates outputs for an integration. This command generates context paths automatically from an example file directly into an integration YAML file. Also supports converting JSON format to Cortex XSOAR entry context YAML format.

Arguments
Argument
Description

-c, --command

Command name (for example xdr-get-incidents).

-j, --json

A JSON file path. If not specified, the script will wait for user input in the terminal.

-p, --prefix

Output prefix such as Jira.Ticket, VirusTotal.IP.

-o, --output

Output file path. If not specified, prints to stdout.

--interactive

If passed, then for each output field the user is asked interactively to enter the description. By default, interactive mode is disabled.

-d, --descriptions

A JSON or a path to a JSON file, mapping field names to their descriptions.

-i, --input

Path of the YAML file (outputs are inserted here in place) - used for context from examples.

-e, --examples

For integrations: The path for a file containing examples. Each command should be in a separate line or a comma-separated list of commands.

For scripts: The script example surrounded by single quotes. For example: -e '!ConvertFile entry_id=<entry_id>'.

--insecure

Skip certificate validation when authorizing Cortex XSOAR or Cortex XSIAM.

--ai

AI description generation - *Experimental* a new way to use GPT-like transformers to generate descriptions from context paths.

Notes

The output of the command is written in the input file (in place).

Examples

demisto-sdk generate-outputs -i Packs/MyPack/Integrations/MyInt/MyInt.yml -e Packs/MyPack/Integrations/MyInt/command_example.txt

Before the command is run:

 commands:
    ...
  name: guardicore-get-incident
  outputs: []
    ...

After the command is run:

commands:
  ...
  name: guardicore-get-incident
  outputs:
  - contextPath: Guardicore.Incident._cls
    description: ''
    type: String
  - contextPath: Guardicore.Incident.affected_assets.ip
    description: ''
    type: String
    ...

demisto-sdk generate-outputs -c jira-get-ticket -p Jira.Ticket -j path/to/valid.json

If the valid.json file contains:

{
    "id": 100,
    "title": "do something title",
    "created_at": "2019-01-01T00:00:00"
}

The generate-outputs command prints to stdout:

arguments: []
name: jira-get-ticket
outputs:
- contextPath: Jira.Ticket.id
  description: ''
  type: Number
- contextPath: Jira.Ticket.title
  description: ''
  type: String
- contextPath: Jira.Ticket.created_at
  description: ''
  type: Date
Experimental: Usage of --ai flag

To use the --ai flag you need to register with ai21.com and obtain an API key. Replace KEYHERE in the examples below with your API key. Don't share your key with anyone. Follow the terms and guidelines of the service: https://studio.ai21.com/terms-of-use https://studio.ai21.com/docs/responsible-use/

With JSON-to-Outputs

The --ai flag can be used together with the --json flag to add descriptions to the generated outputs from the json-to-outputs flow, such as: AI21_KEY=KEYHERE demisto-sdk generate-outputs --json test.json -c "test-command" -p "somePrefix" --ai -o out.yml.

With examples

The --ai flag can be used together with the --examples flag to add descriptions to the generated outputs from the examples flow, such as: AI21_KEY=KEYHERE demisto-sdk generate-outputs --examples ./examples_test -i ~/examples.yml --ai.

Standalone

You can also use the flag on a regular integration YAML file such as: AI21_KEY=KEYHERE demisto-sdk generate-outputs -i input.yml --ai -o outout.yml.

Last updated

Was this helpful?