> 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/run.md).

# run

This command enables you to run integration or script commands in the Playground of a remote Cortex XSOAR/XSIAM instance and pretty print the output. This is useful when developing new commands or fixing bugs, because it lets you debug the code directly from the CLI and optimize the development process flow.

The run command requires interactions with Cortex XSIAM or Cortex XSOAR. Before you use the command, verify you have set up the [environment variables](/demisto-sdk-development-guide/demisto-sdk-guide/install-demisto-sdk/environment-variables-setup.md).

<details>

<summary>Arguments</summary>

| Argument                      | Description                                                                                                                                                                     |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-q QUERY, --query QUERY`     | The query to run.                                                                                                                                                               |
| `--insecure`                  | Skips certificate validation.                                                                                                                                                   |
| `--json-to-outputs`           | Whether to run `json-to-outputs` command on the context output of the query. If the context output does not exist or the `-r` flag is used, uses the raw response of the query. |
| `-p, --prefix`                | Used with `json-to-outputs` flag. Output prefix e.g. `Jira.Ticket`, `VirusTotal.IP`, the base path for the outputs that the script generates.                                   |
| `-r, --raw-response`          | Used with `json-to-outputs` flag. Use the raw response of the query for `json-to-outputs`.                                                                                      |
| `-D, --debug`                 | Whether to enable the `debug-mode` feature. If you want to save the output file, use the `--debug-path` option.                                                                 |
| `--debug-path PATH\_TO\_FILE` | The path where you want to save the debug file. If not specified, the debug file prints to the terminal.                                                                        |

</details>

<details>

<summary>Examples</summary>

{% hint style="info" %}
**Note**

The `!` character is not mandatory; it is added automatically if needed. Either double quotes `"` or single quotes `'` can be used to wrap the query.
{% endhint %}

* `demisto-sdk run -q 'ip ip="8.8.8.8"'`

  Runs the query `!ip ip="8.8.8.8"` on the playground of the Cortex XSOAR pr Cortex XSIAM instance and prints the output.
* `demisto-sdk run -q "panorama-list-address-groups"`

  Runs the query `!panorama-list-address-groups` on the playground of the Cortex XSOAR or Cortex XSIAM instance and prints the output.
* `demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"'`

  Runs the query `!gct-translate-text text="ciao" target="iw"` on the playground of the Cortex XSOAR or Cortex XSIAM instance and prints the output.
* `demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -k`

  Runs the query `!gct-translate-text text="ciao" target="iw"` on the playground of the Cortex XSOAR or Cortex XSIAM instance without certificate validation, and prints the output.
* `demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -v`

  Runs the query `!gct-translate-text text="ciao" target="iw"` on the playground of the Cortex XSOAR or Cortex XSIAM instance, prints the output and additional meta-data.
* `demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -D`

  Runs the query `!gct-translate-text text="ciao" target="iw"` in debug mode (with debug-mode="true") on the playground of the Cortex XSOAR or Cortex XSIAM instance, prints the output, retrieves the debug log file and pretty prints it.
* `demisto-sdk run -q '!gct-translate-text text="ciao" target="iw"' -D --debug-path output.log`

  Runs the query `!gct-translate-text text="ciao" target="iw"` in debug mode (with debug-mode="true") on the playground of the Cortex XSOAR or Cortex XSIAM instance, prints the output and creates the output.log file that contains the command debug logs.

</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/run.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.
