> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/demisto-sdk-development-guide/demisto-sdk-guide/demisto-sdk-commands/generate-outputs.md).

# generate-outputs

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.

<details>

<summary>Arguments</summary>

| 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`     | <p>For integrations: The path for a file containing examples. Each command should be in a separate line or a comma-separated list of commands.</p><p>For scripts: The script example surrounded by single quotes. For example: <code>-e '!ConvertFile entry\_id=\<entry\_id>'</code>.</p> |
| `--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.                                                                                                                                                          |

</details>

<details>

<summary>Notes</summary>

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

</details>

<details>

<summary>Examples</summary>

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

Before the command is run:

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

After the command is run:

```programlisting
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:

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

The `generate-outputs` command prints to `stdout`:

```programlisting
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
```

</details>

<details>

<summary>Experimental: Usage of --ai flag</summary>

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/](https://studio.ai21.com/terms-of-use%20https://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`.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/demisto-sdk-development-guide/demisto-sdk-guide/demisto-sdk-commands/generate-outputs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
