Skip to main content
Version: 2.15 (deprecated)

run


pants run [args]

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: pants.core

Config section: [run]

Basic options

args

--run-args="[<shell_str>, <shell_str>, ...]", ... -- [<shell_str> [<shell_str> [...]]]
PANTS_RUN_ARGS
pants.toml
[run]
args = [
<shell_str>,
<shell_str>,
...,
]
default: []

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

debug_adapter

--[no-]run-debug-adapter
PANTS_RUN_DEBUG_ADAPTER
pants.toml
[run]
debug_adapter = <bool>
default: False

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.

Advanced options

None

Deprecated options

cleanup

--[no-]run-cleanup
PANTS_RUN_CLEANUP
pants.toml
[run]
cleanup = <bool>
default: True
Deprecated, will be removed in version: 2.16.0.dev1.
Use the global `keep_sandboxes` option instead.

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.