Skip to main content
nx run executes a single named target defined in a project’s configuration. Nx checks the local cache before executing the task; if a matching cache entry exists the cached output is replayed instead of re-running the command.

Infix notation

You can omit the run subcommand by placing the target first:

Arguments

string
The name of the project to run the target for.
string
required
The name of the target to run (e.g., build, serve, test, lint).
string
The named configuration to activate for the target (e.g., production, development). Equivalent to --configuration.

Options

string
The configuration to use when running the target. Alias: -c.
boolean
default:"false"
Rerun the task even when a matching result is available in the cache. Alias: --disable-nx-cache.
boolean
default:"false"
Disable the remote cache for this run. Alias: --disable-remote-cache.
string
Controls how task output is displayed. Choices: tui, dynamic, dynamic-legacy, static, stream, stream-without-prefixes.
string
Show the task graph instead of running it. Pass a file path to save the graph to a file, or stdout to print to the terminal.
boolean
default:"false"
Stop command execution after the first failed task.
boolean
default:"false"
Ignore cycles in the task graph.
boolean
default:"false"
Skip running dependent tasks before the specified target.
boolean
default:"false"
Skip running sync generators associated with the task.
boolean
Run tasks in batches for executors that support batch execution.
string
The name of the tasks runner configured in nx.json.
boolean
Enable or disable the Nx Terminal UI. Conflicts with --output-style.
string
Whether to exit the TUI automatically after all tasks finish. Pass true to exit immediately, false to never auto-exit, or a number of seconds to show a countdown before exiting.
boolean
Prints additional information about the command (e.g., stack traces).

Examples

Run nx run myapp:build --help to see the executor-specific options for any target.

Passing options to the executor

Any flags not recognized by Nx are forwarded directly to the underlying executor. For example:
Flags after -- are also forwarded verbatim: