Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt

Use this file to discover all available pages before exploring further.

nx run [project][:target][:configuration] [options]
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:
nx <target> <project> [options]
nx run myapp:build
nx run myapp:build:production
nx run myapp:serve:development

Arguments

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

Options

--configuration
string
The configuration to use when running the target. Alias: -c.
--skip-nx-cache
boolean
default:"false"
Rerun the task even when a matching result is available in the cache. Alias: --disable-nx-cache.
--skip-remote-cache
boolean
default:"false"
Disable the remote cache for this run. Alias: --disable-remote-cache.
--output-style
string
Controls how task output is displayed. Choices: tui, dynamic, dynamic-legacy, static, stream, stream-without-prefixes.
--graph
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.
--nx-bail
boolean
default:"false"
Stop command execution after the first failed task.
--nx-ignore-cycles
boolean
default:"false"
Ignore cycles in the task graph.
--exclude-task-dependencies
boolean
default:"false"
Skip running dependent tasks before the specified target.
--skip-sync
boolean
default:"false"
Skip running sync generators associated with the task.
--batch
boolean
Run tasks in batches for executors that support batch execution.
--runner
string
The name of the tasks runner configured in nx.json.
--tui
boolean
Enable or disable the Nx Terminal UI. Conflicts with --output-style.
--tui-auto-exit
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.
--verbose
boolean
Prints additional information about the command (e.g., stack traces).

Examples

nx run myapp:build
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:
nx run myapp:build --sourcemap --watch
Flags after -- are also forwarded verbatim:
nx run myapp:test -- --testPathPattern=auth