> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/deployr/reference/step-definitions/run-command-line.md).

# Run command line

The **Run command line** step runs arbitrary commands using `cmd.exe` on Windows or `bash` on Linux. You do not need to include the shell name as a prefix in the command.

<figure><img src="https://content.gitbook.com/content/8m0VARX9oyZ2zXWCdPgr/blobs/4LObKyS44JH9Gl7PagDq/image.png" alt=""><figcaption></figcaption></figure>

The command must not prompt for user input, as this would cause the process to hang. By default, the command runs hidden and user interaction is not supported.

Optional settings let you configure the working directory (which defaults to the location of the specified content item), success codes (default: `0 3010`), and a timeout in minutes. If the process exceeds the timeout, it is terminated and the step fails.

The output from the command will automatically be captured into the DeployR log.

### Options

| Option            | Description                                                                                                                                                                                                                                                                                                                                                                                    |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Command Line      | The command to run.                                                                                                                                                                                                                                                                                                                                                                            |
| Working directory | Folder to run the command in. Default: the folder of the specified content item.                                                                                                                                                                                                                                                                                                               |
| Success codes     | Return codes that mean success, separated by spaces (commas and semicolons also work). Codes can be decimal, including negative values, or hexadecimal with a `0x` prefix, such as `0x80070005`. Default: `0 3010`. Any other return code fails the step. If `3010` is in the list, it also restarts the device before the next step. An invalid entry fails the step before the command runs. |
| Timeout           | Time limit for the command, in minutes; `0` means no limit. Default: `15`.                                                                                                                                                                                                                                                                                                                     |
| Show UI           | Shows the command's window so that it can interact with the desktop. When turned on, the command's output is not captured in the DeployR log. Default: `false`.                                                                                                                                                                                                                                |
| Content ID        | Optional content item containing files the command needs.                                                                                                                                                                                                                                                                                                                                      |

{% hint style="info" %}
Note: Most commands could also be executed using a **Run PowerShell script** step.
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/deployr/reference/step-definitions/run-command-line.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
