HomeDocs
DocsCommunityTestimonialsUsersGitHubTwitterBlogJobsTermsPrivacyCookies
TermsPrivacyCookies
Hey! These docs are for version 2.13, which is no longer officially supported. Click here for the latest version, 2.17!




Runs a binary target.

This goal propagates the return code of the underlying executable.

If your application can safely be restarted while it is running, you can pass `restartable=True` on your binary target (for supported types), and the `run` goal will automatically restart them as all relevant files change. This can be particularly useful for server applications.

Backend: <span style="color: purple"><code>pants.core</code></span> Config section: <span style="color: purple"><code>[run]</code></span>

## Basic options

<div style="color: purple">

### `args`

<code>--run-args="[&lt;shell_str&gt;, &lt;shell_str&gt;, ...]", ... -- [<shell_str> [<shell_str> [...]]]</code><br> <code>PANTS_RUN_ARGS</code><br>

</div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>[]</code></span>

<br>

Arguments to pass directly to the executed target, e.g. `--run-args='val1 val2 --debug'`.

</div> <br>

<div style="color: purple">

### `cleanup`

<code>--[no-]run-cleanup</code><br> <code>PANTS_RUN_CLEANUP</code><br>

</div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>True</code></span> <p style="color: darkred">Upcoming deprecation in version: 2.15.0.dev1, is scheduled to be removed in version: 2.16.0.dev1.<br>Use the global `keep_sandboxes` option instead.</p> <br>

Whether to clean up the temporary directory in which the binary is chrooted. Set this to false to retain the directory, e.g., for debugging.

Note that setting the global --keep-sandboxes option may also conserve this directory, along with those of all other processes that Pants executes. This option is more selective and controls just the target binary's directory.

</div> <br>

<div style="color: purple">

### `debug_adapter`

<code>--[no-]run-debug-adapter</code><br> <code>PANTS_RUN_DEBUG_ADAPTER</code><br>

</div> <div style="padding-left: 2em;"> <span style="color: green">default: <code>False</code></span>

<br>

Run the interactive process using a Debug Adapter (https://microsoft.github.io/debug-adapter-protocol/) for the language if supported.

The interactive process used will be immediately blocked waiting for a client before continuing.

</div> <br>

## Advanced options

None

## Deprecated options

None

## Related subsystems

[debug-adapter](🔗), [filter](🔗)